Mouse right and middle buttons are swapped in X11
aduros opened this issue · 1 comments
It looks like in X11 (and maybe also Wayland?) mouse button 2 is middle and 3 is right.
We could fix either by swapping the button codes to be consistent with the other platforms, or making the MOUSE_RIGHT
and MOUSE_MIDDLE
values vary depending on the platform.
Let me know if you have a favored approach and I can open a PR 😃
I would prefer to modify the code if it's wrong / not coherent. I cannot access a Linux machine now but looking at the code.
On Windows mouse buttons are:
1 = left button
2 = right button
3 = middle button (pressing the scroll wheel)
On MacOS mouse buttons are:
1 = left button
2 = right button
3... Others
On X11 mouse buttons are:
1 = left button
2 = middle button (pressing the scroll wheel)
3 = right button
And as I can see in the Wayland code, the buttons are:
#define BTN_MOUSE. 0x110
#define BTN_LEFT 0x110
#define BTN_RIGHT 0x111
#define BTN_MIDDLE. 0x112
1 = left button
2 = right button
3 = middle button (pressing the scroll wheel)
On iOS and Android:
Touches start at 0. Not at 1.
I guess you are right and we have to normalize them. It will be nice if you fix the X11 version. It seems that the other OSes are right but mobile (at this point I'm not sure what to do with them as they support multitouch).
Thanks in advance, Bruno