aboutsummaryrefslogtreecommitdiffstats
path: root/src/x11.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/x11.c')
-rw-r--r--src/x11.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/x11.c b/src/x11.c
index 614b7ac..ed249a8 100644
--- a/src/x11.c
+++ b/src/x11.c
@@ -741,7 +741,14 @@ translateEvent(PuglView* const view, XEvent xevent)
event.button.xRoot = xevent.xbutton.x_root;
event.button.yRoot = xevent.xbutton.y_root;
event.button.state = translateModifiers(xevent.xbutton.state);
- event.button.button = xevent.xbutton.button;
+ event.button.button = xevent.xbutton.button - 1;
+ if (event.button.button == 1) {
+ event.button.button = 2;
+ } else if (event.button.button == 2) {
+ event.button.button = 1;
+ } else if (event.button.button >= 7) {
+ event.button.button -= 4;
+ }
}
break;
case KeyPress: