summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Osterlund <petero2@telia.com>2004-12-24 01:33:00 +0100
committerPeter Osterlund <petero2@telia.com>2006-04-09 04:02:59 +0200
commit373fcceef5218608817785d059c0f99194cb5ce8 (patch)
tree316dacc3978d663e97188ee00c749a344afb178f
parentcba36232215d8fe75ec6f06098a1d0caef71322b (diff)
Support up to 12 (virtual) mouse buttons.
-rw-r--r--synaptics.c10
-rw-r--r--synaptics.h2
-rw-r--r--synclient.c14
3 files changed, 16 insertions, 10 deletions
diff --git a/synaptics.c b/synaptics.c
index 2c5741f..d5a49ca 100644
--- a/synaptics.c
+++ b/synaptics.c
@@ -535,14 +535,18 @@ static Bool
DeviceInit(DeviceIntPtr dev)
{
LocalDevicePtr local = (LocalDevicePtr) dev->public.devicePrivate;
- unsigned char map[] = {0, 1, 2, 3, 4, 5, 6, 7};
+ unsigned char map[SYN_MAX_BUTTONS + 1];
+ int i;
DBG(3, ErrorF("Synaptics DeviceInit called\n"));
+ for (i = 0; i <= SYN_MAX_BUTTONS; i++)
+ map[i] = i;
+
dev->public.on = FALSE;
InitPointerDeviceStruct((DevicePtr)dev, map,
- 7,
+ SYN_MAX_BUTTONS,
miPointerGetMotionEvents, SynapticsCtrl,
miPointerGetMotionBufferSize());
@@ -904,7 +908,7 @@ SelectTapButton(SynapticsPrivate *priv, edge_type edge)
}
priv->tap_button = priv->synpara->tap_action[tap];
- priv->tap_button = clamp(priv->tap_button, 0, 7);
+ priv->tap_button = clamp(priv->tap_button, 0, SYN_MAX_BUTTONS);
}
static void
diff --git a/synaptics.h b/synaptics.h
index 33a0c22..ca4406a 100644
--- a/synaptics.h
+++ b/synaptics.h
@@ -18,6 +18,8 @@ typedef enum {
MAX_TAP
} TapEvent;
+#define SYN_MAX_BUTTONS 12 /* Max number of mouse buttons */
+
struct SynapticsHwInfo {
unsigned int model_id; /* Model-ID */
unsigned int capabilities; /* Capabilities */
diff --git a/synclient.c b/synclient.c
index 7cc702f..7898e1b 100644
--- a/synclient.c
+++ b/synclient.c
@@ -91,13 +91,13 @@ static struct Parameter params[] = {
DEFINE_PAR("TouchpadOff", touchpad_off, PT_BOOL, 0, 1),
DEFINE_PAR("GuestMouseOff", guestmouse_off, PT_BOOL, 0, 1),
DEFINE_PAR("LockedDrags", locked_drags, PT_BOOL, 0, 1),
- DEFINE_PAR("RTCornerButton", tap_action[RT_TAP], PT_INT, 0, 7),
- DEFINE_PAR("RBCornerButton", tap_action[RB_TAP], PT_INT, 0, 7),
- DEFINE_PAR("LTCornerButton", tap_action[LT_TAP], PT_INT, 0, 7),
- DEFINE_PAR("LBCornerButton", tap_action[LB_TAP], PT_INT, 0, 7),
- DEFINE_PAR("TapButton1", tap_action[F1_TAP], PT_INT, 0, 7),
- DEFINE_PAR("TapButton2", tap_action[F2_TAP], PT_INT, 0, 7),
- DEFINE_PAR("TapButton3", tap_action[F3_TAP], PT_INT, 0, 7),
+ DEFINE_PAR("RTCornerButton", tap_action[RT_TAP], PT_INT, 0, SYN_MAX_BUTTONS),
+ DEFINE_PAR("RBCornerButton", tap_action[RB_TAP], PT_INT, 0, SYN_MAX_BUTTONS),
+ DEFINE_PAR("LTCornerButton", tap_action[LT_TAP], PT_INT, 0, SYN_MAX_BUTTONS),
+ DEFINE_PAR("LBCornerButton", tap_action[LB_TAP], PT_INT, 0, SYN_MAX_BUTTONS),
+ DEFINE_PAR("TapButton1", tap_action[F1_TAP], PT_INT, 0, SYN_MAX_BUTTONS),
+ DEFINE_PAR("TapButton2", tap_action[F2_TAP], PT_INT, 0, SYN_MAX_BUTTONS),
+ DEFINE_PAR("TapButton3", tap_action[F3_TAP], PT_INT, 0, SYN_MAX_BUTTONS),
DEFINE_PAR("CircularScrolling", circular_scrolling, PT_BOOL, 0, 1),
DEFINE_PAR("CircScrollDelta", scroll_dist_circ, PT_DOUBLE, .01, 3),
DEFINE_PAR("CircScrollTrigger", circular_trigger, PT_INT, 0, 8),