views:

8

answers:

0

I own a Razer Naga Mouse, essentaly it has a small numpad on the side of it. I want to remap these keys to different unused keys or to bash commands. I can do this easily by using xev to grab the keycode (for instance the "1" on the mouse is keycode 87) and then I can use xmodmap to bind the keycode to a different key.

However the numpad on my keyboard will also inherit this as the keycode is the same, what I noticed though is that the "serial" is different.

For instance here is the output from xev when pressing the "1" button on my mouse numpad.

KeyPress event, serial 34, synthetic NO, window 0x1c00001,
root 0x1ae, subw 0x0, time 2179878, (170,-2), root:(198,345),
state 0x0, keycode 87 (keysym 0xff9c, KP_End), same_screen YES,
XLookupString gives 0 bytes: 
XmbLookupString gives 0 bytes: 
XFilterEvent returns: False

KeyRelease event, serial 35, synthetic NO, window 0x1c00001,
root 0x1ae, subw 0x0, time 2179966, (170,-2), root:(198,345),
state 0x0, keycode 87 (keysym 0xff9c, KP_End), same_screen YES,
XLookupString gives 0 bytes: 
XFilterEvent returns: False

and here is the output when pressing "1" on my keyboards numpad

KeyPress event, serial 35, synthetic NO, window 0x1c00001,
root 0x1ae, subw 0x0, time 2180261, (170,-2), root:(198,345),
state 0x0, keycode 87 (keysym 0xff9c, KP_End), same_screen YES,
XLookupString gives 0 bytes: 
XmbLookupString gives 0 bytes: 
XFilterEvent returns: False

KeyRelease event, serial 36, synthetic NO, window 0x1c00001,
root 0x1ae, subw 0x0, time 2180341, (170,-2), root:(198,345),
state 0x0, keycode 87 (keysym 0xff9c, KP_End), same_screen YES,
XLookupString gives 0 bytes: 
XFilterEvent returns: False

Is there anyway I could map the keys on my mouse based on this?