1

I am trying to follow this guide to using a Logitech G600. I have (using a windows computer) mapped each key combo on the mouse to something on a normal keyboard. I have set up some rules in /etc/udev/hwdb.d/ to map the scancodes to some extended keycodes (found here). All of this works fine, except that X doesn't recognize keycodes greater than 255. So, the line

 KEYBOARD_KEY_7001d=zenkakuhankaku

causes the mouse button to spit out keycode 400 (via showkey) and xev doesn't recognize the key at all.

I have also tried running xmodmap -pke | grep "= XF86" to show the keycodes that are less than 255 that should be available, but can't figure out how to map the scancode to those keycodes (i.e. KEYBOARD_KEY_7001d=XF86Explorer leaves the key mapped to "z").

Is there a way to map a scancode directly to a numeric keycode (in the hwdb file - I have no desire to map everything that issues the letter "a" to XF86Calculator)?

Is there some other way to map the scan code to one of the unused XF86 codes?

0

Okay, so here's what I ended up doing. I pulled the actual key names from /usr/include/linux/input.h. There's a section where the keycode names are defined that looks like:

#define KEY_RIGHTMETA           126
#define KEY_COMPOSE             127
#define KEY_STOP                128     /* AC Stop */
#define KEY_AGAIN               129
#define KEY_PROPS               130     /* AC Properties */

I used the lowercase xxx in KEY_xxx (so, "compose", "stop", etc.) as the key names. I picked things that looked like they wouldn't really be used elsewhere (like KEY_LEFTCTRL).

Then, like the article linked suggested, I used xbindkeys -km to get the appropriate keycode numbers and used xbindkeys to map them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.