From 373fcceef5218608817785d059c0f99194cb5ce8 Mon Sep 17 00:00:00 2001 From: Peter Osterlund Date: Fri, 24 Dec 2004 01:33:00 +0100 Subject: Support up to 12 (virtual) mouse buttons. --- synaptics.c | 10 +++++++--- synaptics.h | 2 ++ synclient.c | 14 +++++++------- 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), -- cgit v1.2.3