]> git.armaanb.net Git - st.git/blobdiff - x.c
fix: correctly encode mouse buttons >= 8 in X10 and SGR mode
[st.git] / x.c
diff --git a/x.c b/x.c
index 120e495df49c650856251a785e9716acf90d6a39..8bf998e1dedb7ad592a03b985db2e606f9523ec9 100644 (file)
--- a/x.c
+++ b/x.c
@@ -387,7 +387,9 @@ mousereport(XEvent *e)
                        button = 3;
                } else {
                        button -= Button1;
-                       if (button >= 3)
+                       if (button >= 7)
+                               button += 128 - 7;
+                       else if (button >= 3)
                                button += 64 - 3;
                }
                if (e->xbutton.type == ButtonPress) {