views:

17

answers:

0

Hello,

I've got a mouse with scroll and a keyboard with scroll. Both devices are connected using USB, both scrolls send the same event ("mouse button 4/5 press/release"). I'd like to map up/down arrow keys to the keyboard scroll, but not the mouse scroll.

Any ideas of how to do this programatically? I think I have to do this at the X server level, because Xlib's structures doesn't seem to contain enough information to find out the source device.

EDIT: Xev shows for mouse:

ButtonRelease event, serial 30, synthetic NO, window 0x600001,
    root 0x111, subw 0x0, time 33281725, (70,99), root:(74,172),
    state 0x810, button 4, same_screen YES

and for keyboard:

ButtonRelease event, serial 33, synthetic NO, window 0x600001,
    root 0x111, subw 0x0, time 33292967, (72,117), root:(76,190),
    state 0x810, button 4, same_screen YES