Some mice have more than 3 buttons. Although Xlib.h doesn't provide
definitions for these buttons, button 6 to 9 is reported through the
XButtonEvent struct.
This adds support for mapping actions to mouse button 6 to 9.
>From 279f89d390ef7baeabc45a8315a6e89714a0d883 Mon Sep 17 00:00:00 2001
From: Dark Ayron <ay...@shadowdrake.eu>
Date: Sat, 15 Mar 2025 14:15:21 +0000
Subject: dtwm: add support for more mouse buttons

Some mice have more than 3 buttons. Although Xlib.h doesn't provide
definitions for these buttons, button 6 to 9 is reported through the
XButtonEvent struct.
This adds support for mapping actions to mouse button 6 to 9.
---
 cde/programs/dtwm/WmResParse.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/cde/programs/dtwm/WmResParse.c b/cde/programs/dtwm/WmResParse.c
index 6fc5a5c65..b67ad9771 100644
--- a/cde/programs/dtwm/WmResParse.c
+++ b/cde/programs/dtwm/WmResParse.c
@@ -105,6 +105,14 @@ extern int errno;
 # define LANG_DT_WMRC    "/dtwmrc"
 # define SYS_DT_WMRC     CDE_CONFIGURATION_TOP "/sys.dtwmrc"
 
+/*
+ * missing button definitions in X.h
+ */
+#define Button6	6
+#define Button7	7
+#define Button8	8
+#define Button9	9
+
 /*
  * Global Variables And Tables:
  */
@@ -243,6 +251,22 @@ static EventTableEntry buttonEvents[] = {
     {"btn5up",      ButtonRelease,  ParseImmed,    Button5,  FALSE},
     {"btn5click",   ButtonRelease,  ParseImmed,    Button5,  TRUE},
     {"btn5click2",  ButtonPress,    ParseImmed,    Button5,  TRUE},
+    {"btn6down",    ButtonPress,    ParseImmed,    Button6,  FALSE},
+    {"btn6up",      ButtonRelease,  ParseImmed,    Button6,  FALSE},
+    {"btn6click",   ButtonRelease,  ParseImmed,    Button6,  TRUE},
+    {"btn6click2",  ButtonPress,    ParseImmed,    Button6,  TRUE},
+    {"btn7down",    ButtonPress,    ParseImmed,    Button7,  FALSE},
+    {"btn7up",      ButtonRelease,  ParseImmed,    Button7,  FALSE},
+    {"btn7click",   ButtonRelease,  ParseImmed,    Button7,  TRUE},
+    {"btn7click2",  ButtonPress,    ParseImmed,    Button7,  TRUE},
+    {"btn8down",    ButtonPress,    ParseImmed,    Button8,  FALSE},
+    {"btn8up",      ButtonRelease,  ParseImmed,    Button8,  FALSE},
+    {"btn8click",   ButtonRelease,  ParseImmed,    Button8,  TRUE},
+    {"btn8click2",  ButtonPress,    ParseImmed,    Button8,  TRUE},
+    {"btn9down",    ButtonPress,    ParseImmed,    Button9,  FALSE},
+    {"btn9up",      ButtonRelease,  ParseImmed,    Button9,  FALSE},
+    {"btn9click",   ButtonRelease,  ParseImmed,    Button9,  TRUE},
+    {"btn9click2",  ButtonPress,    ParseImmed,    Button9,  TRUE},
     { NULL, 0, (Boolean(*)())NULL,  0, FALSE}
 };
 
-- 
2.45.3

_______________________________________________
cdesktopenv-devel mailing list
cdesktopenv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdesktopenv-devel

Reply via email to