Keystroke flow in X.org

Peter Hutterer peter.hutterer at who-t.net
Fri Jun 12 05:26:17 PDT 2009


On Fri, Jun 12, 2009 at 05:21:53PM +1000, Timothy S. Nelson wrote:
> On Fri, 12 Jun 2009, Timothy S. Nelson wrote:
>
>> 	So, here's my impression of how it works based on what you've just  
>> said.
>
> [snip]
>
> 	Yuck.  Let me do some more reworking.
>
> -	When a keystroke comes from the hardware, it gets picked up and sent
> 	to the client (ie. application/program). -	The application program 
> (calling on ???) translates it into a
> 	character using the following process:
> 	-	Translates from a key/scan code into a symbol using the xmodmap map
> 	-	The translation table is generated from xkb/*.
> 	-	The compose/locale stuff happens after the xmodmap translation table.
>
> 	Is that better?

yeah, close enough, except that in most cases xmodmap has little influence
on anything. I can't remember the last time I used it when it wasn't to
debug some weird setup from a bugreport. it's something like:

1. server starts up, compiles XKB map for each keyboard device based on
   xkeyboard-config's files using xkbcomp.
2. clients query server for the XKB map and store it or use it to spread
   love and/or happiness.
3. key event comes in, driver adds 8 because, hey, why not. also, bonghits.
4. (scancode + 8) passes through the XKB layer. if it's not assigned to any
   action (e.g. Terminate_Server) it's just passed through and sent to
   the client.
5. client gets keycode, uses previously obtained XKB map to look up keysym.
   then does something to render it (I really don't know this part).

if the physical keyboard changes, the server sends out a keymap notify event
and the cycle starts at 2 again. Hopefully, anyway, otherwise the amount of
happiness is significantly less than hoped for (up key printscreen misc
snafu).

also, friday. beer. mhmmm. beer. *drool*.

Cheers,
  Peter




More information about the xorg mailing list