Converting linux keycodes to X keycodes

Park Ji Wong happyarch at gmail.com
Wed May 31 23:27:58 PDT 2006


Sorry to interrupt here,
But i have a question, the keycode's value differ to each platform(arm, x86)?




2006/5/31, Marvin Raaijmakers <marvin.nospam at gmail.com>:
> If the remote control is connected via USB it will not be possible to
> set keycodes. At the moment I am trying to modify the input drivers to
> make this possible.
> If you can set the kernel keycode, then of course you can get the X
> keycode by using xev. However you may find it easier to use the
> translation table I made:
>
> /* Kernel keycode -> X keycode table */
> const unsigned int keycode_table[256] = {
> 	  0,   9,  10,  11,  12,  13,  14,  15,  16,  17,  18,  19,  20,  21,
> 22,  23,
> 	 24,  25,  26,  27,  28,  29,  30,  31,  32,  33,  34,  35,  36,  37,
> 38,  39,
> 	 40,  41,  42,  43,  44,  45,  46,  47,  48,  49,  50,  51,  52,  53,
> 54,  55,
> 	 56,  57,  58,  59,  60,  61,  62,  63,  64,  65,  66,  67,  68,  69,
> 70,  71,
> 	 72,  73,  74,  75,  76,  77,  76,  79,  80,  81,  82,  83,  84,  85,
> 86,  87,
> 	 88,  89,  90,  91, 111,  221, 94,  95,  96, 211, 128, 127, 129, 208,
> 131, 126,
> 	108, 109, 112, 111, 113, 181,  97,  98,  99, 100, 102, 103, 104, 105,
> 106, 107,
> 	239, 160, 174, 176, 222, 157, 123, 110, 139, 134, 209, 210, 133, 115,
> 116, 117,
> 	232, 133, 134, 135, 140, 248, 191, 192, 122, 188, 245, 158, 161, 193,
> 223, 227,
> 	198, 199, 200, 147, 159, 151, 178, 201, 146, 203, 166, 236, 230, 235,
> 234, 233,
> 	163, 204, 253, 153, 162, 144, 164, 177, 152, 190, 208, 129, 130, 231,
> 209, 210,
> 	136, 220, 143, 246, 251, 137, 138, 182, 183, 184,  93, 184, 247, 132,
> 170, 219,
> 	249, 205, 207, 149, 150, 154, 155, 167, 168, 169, 171, 172, 173, 165,
> 175, 179,
> 	180,   0, 185, 186, 187, 118, 119, 120, 121, 229, 194, 195, 196, 197,
> 148, 202,
> 	101, 212, 237, 214, 215, 216, 217, 218, 228, 142, 213, 240, 241, 242,
> 243, 244,
> 	  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
> 0,   0
> };
>
> I made this table for my project keyTouch (http://keytouch.sf.net). If
> it is possible to the set keycodes for your remote control, then you can
> even use this program to bind actions to it. KeyTouch assigns kernel
> keycodes to scancodes, translates the kernel keycode to a X keycode and
> executes an action when that keycode is pressed under X. By using the
> keyTouch editor program you can make a so called keyboard file for your
> remote control and import this keyboard file in keyTouch to get working.
>
> - Marvin Raaijmakers
>
> On Thu, 2006-06-01 at 08:59 +0300, Aivils Stoss wrote:
>
> > On Trešdiena, 31. Maijs 2006 20:31, Jeremy Wilkins wrote:
> > > Hi All,
> > >
> > > I've got an ATI remote control, this worked great in older linux 2.6
> > > kernels but the OK button has changed and now maps to linux keycode
> > > 352 (KEY_OK). I've also managed to find the the scancode using
> > > showkeys.
> > >
> > > How do I find the equivalent X keycode? I've tried xev, but this
> > > appears to only work with keycodes up to 255?
> >
> > Linux kernel does not send keycodes > 255 to X. That is kernel limitation.
> > Set another code on OK button.
> >
> > man setkeycodes
> >
> > Aivils Stoss
> > _______________________________________________
> > xorg mailing list
> > xorg at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/xorg
>
>


-- 
Park Ji Wong



More information about the xorg mailing list