Hi,
Yes most likely.
I find these lines of code:
/* buttons */
ioctl(uinput->fd, UI_SET_EVBIT, EV_KEY);
ioctl(uinput->fd, UI_SET_KEYBIT, BTN_LEFT);
ioctl(uinput->fd, UI_SET_KEYBIT, BTN_MIDDLE);
ioctl(uinput->fd, UI_SET_KEYBIT, BTN_RIGHT);
/* wheel */
ioctl(uinput->fd, UI_SET_EVBIT, EV_REL);
ioctl(uinput->fd, UI_SET_RELBIT, REL_WHEEL);
I will probably need to declare the additional mouse buttons of my mouse (Logitech G403), so I run xev to find some information:
(BTN_LEFT, BTN_RIGHT, button 8, button 9)
ButtonPress event, serial 48, synthetic NO, window 0x3000001,
root 0x3ad, subw 0x0, time 361327, (127,94), root:(128,144),
state 0x0, button 1, same_screen YES
ButtonRelease event, serial 48, synthetic NO, window 0x3000001,
root 0x3ad, subw 0x0, time 361426, (127,94), root:(128,144),
state 0x100, button 1, same_screen YES
ButtonPress event, serial 48, synthetic NO, window 0x3000001,
root 0x3ad, subw 0x0, time 362448, (127,94), root:(128,144),
state 0x0, button 3, same_screen YES
ButtonRelease event, serial 48, synthetic NO, window 0x3000001,
root 0x3ad, subw 0x0, time 362556, (127,94), root:(128,144),
state 0x400, button 3, same_screen YES
ButtonPress event, serial 48, synthetic NO, window 0x3000001,
root 0x3ad, subw 0x0, time 366829, (127,94), root:(128,144),
state 0x0, button 8, same_screen YES
ButtonRelease event, serial 48, synthetic NO, window 0x3000001,
root 0x3ad, subw 0x0, time 366949, (127,94), root:(128,144),
state 0x0, button 8, same_screen YES
ButtonPress event, serial 48, synthetic NO, window 0x3000001,
root 0x3ad, subw 0x0, time 368093, (127,94), root:(128,144),
state 0x0, button 9, same_screen YES
ButtonRelease event, serial 48, synthetic NO, window 0x3000001,
root 0x3ad, subw 0x0, time 368250, (127,94), root:(128,144),
state 0x0, button 9, same_screen YES
Now the next question is obvious: how do I adjust the code to add support for button 8,9 ?
I thought BTN_LEFT and BTN_RIGHT would be declared in uinput.h but they are global variables? or where are they declared?