Merge pull request #67 from aduros/2021-11-15-fix
Swap mouse right and middle buttons on X11 (Fix #65)
This commit is contained in:
commit
f54b94a51f
@ -245,6 +245,18 @@ processEvent(SWindowData *window_data, XEvent *event) {
|
|||||||
mfb_mouse_button button = (mfb_mouse_button) event->xbutton.button;
|
mfb_mouse_button button = (mfb_mouse_button) event->xbutton.button;
|
||||||
int is_pressed = (event->type == ButtonPress);
|
int is_pressed = (event->type == ButtonPress);
|
||||||
window_data->mod_keys = translate_mod(event->xkey.state);
|
window_data->mod_keys = translate_mod(event->xkey.state);
|
||||||
|
|
||||||
|
// Swap mouse right and middle for parity with other platforms:
|
||||||
|
// https://github.com/emoon/minifb/issues/65
|
||||||
|
switch (button) {
|
||||||
|
case Button2:
|
||||||
|
button = Button3;
|
||||||
|
break;
|
||||||
|
case Button3:
|
||||||
|
button = Button2;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
switch (button) {
|
switch (button) {
|
||||||
case Button1:
|
case Button1:
|
||||||
case Button2:
|
case Button2:
|
||||||
|
Loading…
Reference in New Issue
Block a user