More (13) Mouse Buttons
- From: Jeremy Bryan Smith <helamonster gmail com>
- To: sawfish-list gnome org
- Subject: More (13) Mouse Buttons
- Date: Tue, 10 Oct 2006 20:35:13 -0500
I have a "Kensington Expert Mouse Pro" USB trackball device, which in
addition to 4 regular mouse buttons, mouse wheel up/down and mouse wheel
button, has 6 "extra" buttons (for a grand total of 13).
In the past, X did not seem to support those extra buttons and so I was
using a separate program I wrote to configure the buttons, but after
upgrading to Xorg 7.1, I noticed that xev was registering those extra
buttons. So I quickly opened Sawfish Configurator to set them up.
Unfortunately, Sawfish could only recognize 9 buttons. I was able to
modify the source so that Sawfish recognizes these buttons (see
attachment), but now I have another problem.
When I click on the root window, Sawfish recognizes the button clicks
and performs my configured actions. However, if I click on any window
other than the root with buttons 9, 11, 12, and 13, the window is given
focus and my Sawfish command is not executed. I would expect it to act
the same as the others: execute the programmed command and do not set
focus to any window. All of my 6 "extra" buttons (8-13) are configured
to switch to workspaces 1-6, respectively.
I'm not sure if the problem lies in Sawfish or X. My mouse
configurationin xorg.conf is as follows:
# Kensington Expert Mouse Pro (Trackball)
Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Driver "evdev"
Option "Protocol" "Auto"
Option "Dev Name" "Kensington Kensington USB/PS2 Trackball"
Option "Device" "/dev/input/event2"
Option "Buttons" "13"
Option "ZAxisMapping" "6 7"
Option "Emulate3Buttons" "off"
EndSection
#
Any ideas?
--
Jeremy "Helamonster" Smith
diff -ur sawfish/src/keys.c sawfish-modified/src/keys.c
--- sawfish/src/keys.c 2004-11-15 12:29:19.000000000 -0600
+++ sawfish-modified/src/keys.c 2006-10-09 00:02:48.000000000 -0500
@@ -97,7 +97,7 @@
static void grab_keymap_event (repv km, long code, long mods, bool grab);
static void grab_all_keylist_events (repv map, bool grab);
-static int all_buttons[9] = { Button1, Button2, Button3, Button4, Button5, Button6, Button7, Button8, Button9 };
+static int all_buttons[13] = { Button1, Button2, Button3, Button4, Button5, Button6, Button7, Button8, Button9, Button10, Button11, Button12, Button13 };
/* locks: currently LockMask, num_lock, and scroll_lock */
static int total_lock_combs, all_lock_mask;
@@ -275,6 +275,18 @@
case Button9:
*mods |= Button9Mask;
break;
+ case Button10:
+ *mods |= Button10Mask;
+ break;
+ case Button11:
+ *mods |= Button11Mask;
+ break;
+ case Button12:
+ *mods |= Button12Mask;
+ break;
+ case Button13:
+ *mods |= Button13Mask;
+ break;
}
ret = TRUE;
break;
@@ -350,6 +362,10 @@
{ Button7, Button7Mask },
{ Button8, Button8Mask },
{ Button9, Button9Mask },
+ { Button10, Button10Mask },
+ { Button11, Button11Mask },
+ { Button12, Button12Mask },
+ { Button13, Button13Mask },
{ 0, 0 }
};
int i;
@@ -677,6 +693,10 @@
{ "Button7", Button7Mask },
{ "Button8", Button8Mask },
{ "Button9", Button9Mask },
+ { "Button10", Button10Mask},
+ { "Button11", Button11Mask},
+ { "Button12", Button12Mask},
+ { "Button13", Button13Mask},
{ "Any", EV_MOD_ANY },
{ "Release", EV_MOD_RELEASE },
{ 0, 0 }
diff -ur sawfish/src/keys.h sawfish-modified/src/keys.h
--- sawfish/src/keys.h 2004-11-15 12:29:19.000000000 -0600
+++ sawfish-modified/src/keys.h 2006-10-09 00:08:47.000000000 -0500
@@ -105,6 +105,38 @@
# define Button9Mask (1<<16)
#endif
+#ifndef Button10
+# define Button10 10
+#endif
+#ifndef Button10Mask
+# define Button10Mask (1<<17)
+#endif
+
+#ifndef Button11
+# define Button11 11
+#endif
+#ifndef Button11Mask
+# define Button11Mask (1<<18)
+#endif
+
+
+#ifndef Button12
+# define Button12 12
+#endif
+#ifndef Button12Mask
+# define Button12Mask (1<<19)
+#endif
+
+
+#ifndef Button13
+# define Button13 13
+#endif
+#ifndef Button13Mask
+# define Button13Mask (1<<20)
+#endif
+
+
+
#if !defined (Button6)
# define EV_MOD_BUTTON_MASK (Button1Mask | Button2Mask | Button3Mask \
| Button4Mask | Button5Mask)
@@ -119,10 +151,31 @@
# define EV_MOD_BUTTON_MASK (Button1Mask | Button2Mask | Button3Mask \
| Button4Mask | Button5Mask | Button6Mask \
| Button7Mask | Button8Mask)
-#else
+#elif !defined (Button10)
# define EV_MOD_BUTTON_MASK (Button1Mask | Button2Mask | Button3Mask \
| Button4Mask | Button5Mask | Button6Mask \
| Button7Mask | Button8Mask | Button9Mask)
+#elif !defined (Button11)
+# define EV_MOD_BUTTON_MASK (Button1Mask | Button2Mask | Button3Mask \
+ | Button4Mask | Button5Mask | Button6Mask \
+ | Button7Mask | Button8Mask | Button9Mask \
+ | Button10Mask)
+#elif !defined (Button12)
+# define EV_MOD_BUTTON_MASK (Button1Mask | Button2Mask | Button3Mask \
+ | Button4Mask | Button5Mask | Button6Mask \
+ | Button7Mask | Button8Mask | Button9Mask \
+ | Button10Mask | Button11Mask)
+#elif !defined (Button13)
+# define EV_MOD_BUTTON_MASK (Button1Mask | Button2Mask | Button3Mask \
+ | Button4Mask | Button5Mask | Button6Mask \
+ | Button7Mask | Button8Mask | Button9Mask \
+ | Button10Mask | Button11Mask | Button12Mask)
+#else
+# define EV_MOD_BUTTON_MASK (Button1Mask | Button2Mask | Button3Mask \
+ | Button4Mask | Button5Mask | Button6Mask \
+ | Button7Mask | Button8Mask | Button9Mask \
+ | Button10Mask | Button11Mask | Button12Mask \
+ | Button13Mask)
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]