# keycode above 255

## mb1248

Hi,

I use a Win-TV nova-s remote control as pseudo keyboard on /dev/input/event4.

Some keys don't recognize in xev. showkey -k tells that these keys have a keycode above 255.

I want to remap the scancodes to unused keycodes less than 255. 

But showkey -s hasn't an output for these keys.

Is there another tool to recognize scancodes?

/BR

----------

## tobr

 *mb1248 wrote:*   

> Hi,
> 
> I use a Win-TV nova-s remote control as pseudo keyboard on /dev/input/event4.
> 
> Some keys don't recognize in xev. showkey -k tells that these keys have a keycode above 255.
> ...

 

I noticed a strange thing while trying something with both an USB keyboard and a PS/2 keyboard: showkey -s doesn't show the real scancode! I have remapped my PS/2 keyboard (I now have two down-arrow-keys) and those two keys show the same scancode (which is impossible, because it were different keys before). So I guess there's a bug in showkey -s.  You can still see the mapping with getkeycodes when logged into the console. If you know the keycode you can find out the scancode. If there are keys with no corresponding keycode you can press the key and search for a message in /var/log/messages telling you it currently has no keycode and how to assign it one.

EDIT: What I said above works for PS/2 devices, I can not guarantee that it will work with USB devices. For me setkeycodes failed for my USB keyboard attached through an PS/2-to-USB adapter. YMMV

----------

## mb1248

USB and PS/2 have different scancodes, see http://www.win.tue.nl/~aeb/linux/kbd/scancodes-10.html

I have the keycodes, but no scancodes. getkeycodes doesn't list the keys above 255. Neither showkey -s lists the keycodes nor /var/log/messages logged them.

I have used /var/log/messages and setkeycodes to set some keys of my keyboard.

I think X doesn't recognize keys above 255 and showkey -s doesn't it too. Is there another program which show the scancode? Maybe something like cat /dev/input/event4 | hexdump

----------

## 153373

Hi folks,

I have the same problem with my usb mouse Mx610 (Logitech). It has two buttons that are handled as keys (for mail client and instant messenger). One is working well (keycode <= 255), the other doesn't (keycode > 255).

I already found out that the keys are mapped in the kernel module usb-hid. The important source file is drivers/hid/hid-input.c.

At my current kernel version (2.6.22-r8 of gentoo-sources) the line 588 is the important one

                   case 0x1bc: map_key_clear(KEY_MESSENGER);       break;

I don't really know, which kind of code the 0x1bc is, but KEY_MESSENGER = 430 is the key code to which the button is mapped. I can get to work the key by replacing KEY_MESSENGER by some code <= 255, but it should work this way, too.

As already reported by others, showkey -k displays the keycode 430, while showkey -s doesn't display anything for that button.

Nor does xev or any other program I tried (e.g. xfce keyboard settings) recognize the key (i.e. react in any way).

I tried xmodmap -e "keycode 430 = XF86Messenger", but it doesn't change anything (at least it displays no error).

Some additional info: Since the change of KEY_MAX to 0x1ff was quite recent, maybe some programs didn't integrate the fix yet. I use

gentoo-sources 2.6.22-r8

kbd 1.13-r1

xmodmap 1.0.3

xf86-input-evdev 1.1.5-r1

xkeyboard-config 0.9

Are there other packages, that could be outdated?

Greetings, Stephan

----------

