[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: X Keycodes

> On Fri, Oct 04, 2002 at 09:14:22PM +0200, Josef Spillner wrote:
> > On Friday 04 October 2002 16:04, Nathi-huesken@gmx.de wrote:
> > >  can't find anything like a "definition list" which keycode is
> > > related to which actual key.
> You can find key codes in (usually)
> /usr/X11R6/include/X11/keysymdef.h.

You may have already figured it out, but keycodes are hardware-specific -- you probably don't want to use them.  Use keysyms.  The advantage being you get hardware portability, and you also support users who want/need to remap their keys.  Flip up the xmodmap man page for starters; check out "xmodmap -pk" and cat the "swap control and caps lock" example into "xmodmap -" to start getting a feel for what's going on.

Basically:   "App" uses  "keysym" which is mapped to "keycode" which represents a "key".  Keycodes are just numbers.  Keysyms are things like "1" "A" "F10" "CapsLock" etc.