xenocard
May 29th, 2008, 03:47 PM
I have a multimedia keyboard with two Back and Forward buttons that I never use. I'd like to remap them into mouse wheel events: Back would be used to scroll up, Forward to scroll down.
Xkb provides two keysyms that seem to fit my needs: XF86ScrollUp and XF86ScrollDown. I managed to remap my keys to those keysyms, as shown by xev:
KeyPress event, serial 30, synthetic NO, window 0x3e00001,
root 0x3f, subw 0x0, time 113913610, (60,145), root:(65,167),
state 0x10, keycode 234 (keysym 0x1008ff78, XF86ScrollUp), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 30, synthetic NO, window 0x3e00001,
root 0x3f, subw 0x0, time 113913610, (60,145), root:(65,167),
state 0x10, keycode 234 (keysym 0x1008ff78, XF86ScrollUp), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
KeyPress event, serial 30, synthetic NO, window 0x3e00001,
root 0x3f, subw 0x0, time 113914170, (60,145), root:(65,167),
state 0x10, keycode 233 (keysym 0x1008ff79, XF86ScrollDown), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 30, synthetic NO, window 0x3e00001,
root 0x3f, subw 0x0, time 113914170, (60,145), root:(65,167),
state 0x10, keycode 233 (keysym 0x1008ff79, XF86ScrollDown), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
However, my windows wouldn't scroll. They do scroll only if I enable the MouseKeys mode (controlling the mouse with the keypad by pressing Shift+NumLock). Obviously it's not what I want.
So, I was wondering if anyone would have any idea how I could make those keysyms work even when the MouseKeys mode is disabled? Or is there any other means to map mouse events onto keyboard keys?
Thanks
Xkb provides two keysyms that seem to fit my needs: XF86ScrollUp and XF86ScrollDown. I managed to remap my keys to those keysyms, as shown by xev:
KeyPress event, serial 30, synthetic NO, window 0x3e00001,
root 0x3f, subw 0x0, time 113913610, (60,145), root:(65,167),
state 0x10, keycode 234 (keysym 0x1008ff78, XF86ScrollUp), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 30, synthetic NO, window 0x3e00001,
root 0x3f, subw 0x0, time 113913610, (60,145), root:(65,167),
state 0x10, keycode 234 (keysym 0x1008ff78, XF86ScrollUp), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
KeyPress event, serial 30, synthetic NO, window 0x3e00001,
root 0x3f, subw 0x0, time 113914170, (60,145), root:(65,167),
state 0x10, keycode 233 (keysym 0x1008ff79, XF86ScrollDown), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 30, synthetic NO, window 0x3e00001,
root 0x3f, subw 0x0, time 113914170, (60,145), root:(65,167),
state 0x10, keycode 233 (keysym 0x1008ff79, XF86ScrollDown), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
However, my windows wouldn't scroll. They do scroll only if I enable the MouseKeys mode (controlling the mouse with the keypad by pressing Shift+NumLock). Obviously it's not what I want.
So, I was wondering if anyone would have any idea how I could make those keysyms work even when the MouseKeys mode is disabled? Or is there any other means to map mouse events onto keyboard keys?
Thanks