Limit events of a specific keyboard to a specific application

Peter Hutterer peter.hutterer at
Thu Jan 30 14:07:40 PST 2014

On Thu, Jan 30, 2014 at 12:11:30PM +0100, Dr. Zimmermann wrote:
> Hello,
> For research purposes we are measuring human brain activity under
> the influence of external stimuli (visual/auditory/somatosensory).
> The subject has to reply to tasks using 'button boxes' which are
> implemented as (response) keyboards. During the session, the
> operator should control the experiment via the (main) keyboard
> (without getting his keyboard inputs messed up by the response
> keyboards).
> Therefore I have detached the (response-)keyboards from the
> virtual core keyboard
> using the 'xinput --float name-of-response-kbd' comand.
> Next I'd like to attach these keyboards to a specific process only.
> Can someone give some advice how to do that?

Do you control the application? If so, simply use XGrabKeyboard or
XIGrabDevice. And if you do that you don't even need to float them before,
they won't send events through the master keyboard while grabbed.


More information about the xorg mailing list