Input Event Handling
Daniel Stone
daniel at fooishbar.org
Wed Apr 4 12:14:24 PDT 2007
On Wed, Apr 04, 2007 at 10:40:02AM +0200, Thorsten Wilms wrote:
> I'm working on a concept that deals with mapping user input device
> events to actions. For this it would be better to know how input
> events are handled currently. Searched for a while, even had a look
> at the ICCCM but failed to get anything out of it.
>
> I initialy though it would be roughly like this:
> device -> driver->kernel -> userspace
> If X is running:
> device -> driver->kernel -> x-server -> WM -> app that has focus
> Where events can be interpreted and not passed on on every level.
>
> In a random IRC channel I have been told that events are not passed
> through the WM. But how can the WM intercept shortcuts, then?
>
> With further thinking, input focus might happen on 3 levels:
> widget, window, application. Right?
Hi,
Input focus is to a particular window, so you get device -> kernel -> X
server -> app.
> If I hit Alt-F1 to switch to the first console, is that shortcut
> interpreted by the kernel or the x-server?
This is one special case: the XKB layout in the server tells it to
switch consoles when Ctrl-Alt-F1 is pressed, so the clients never see
this at all.
> Does the x-server anything special to receive all input events?
Yes, google for "x11 grab", or man XGrabKeyboard.
> Does the kernel have a concept like input focus?
No, it just sends events to /dev.
> So please enlighten me about what way input events take, where
> they can be intercepted (shortcuts) and how input focus is
> structured.
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.
Cheers,
Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.x.org/archives/xorg/attachments/20070404/e173d847/attachment.pgp>
More information about the xorg
mailing list