Input Event Handling

Thorsten Wilms t_w_ at
Wed Apr 4 13:13:33 PDT 2007

On Wed, Apr 04, 2007 at 10:14:24PM +0300, Daniel Stone wrote:
> Hi,
> Input focus is to a particular window, so you get device -> kernel -> X
> server -> app.

There are cases like sliders in a windows with scrollbars. With 
gtk+ at least, if the pointer is on the slider, mouse-wheel will 
move the slider. But with the pointer anywhere else, the wheel 
Does this mean that input focus has to be redone on the window/ 
application level for things like this to work?

> > Does the x-server anything special to receive all input events?
> Yes, google for "x11 grab", or man XGrabKeyboard.

Ah yes, XGrabKeyboard does it :)

> > Does the kernel have a concept like input focus?
> No, it just sends events to /dev.

There must be some mechanism for only letting a cli app in the 
current virtual console receive input events.

> This is another special case: you can grab particular _keys_.  So if you
> want Alt-F10 to maximise in the window manager, you set a grab on F10
> and check if Alt is also pressed.  If not, you let the event go through
> to its original destination (i.e. the window with input focus), else you
> intercept the event and maximise the window.

So commonly WMs set grabs on ther shortcuts, while application just 
wait and see what comes?

Thank you very much for the info!

Thorsten Wilms

More information about the xorg mailing list