summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/eventcomm.c8
-rw-r--r--src/properties.c3
-rw-r--r--src/synaptics.c7
-rw-r--r--src/synapticsstr.h1
4 files changed, 18 insertions, 1 deletions
diff --git a/src/eventcomm.c b/src/eventcomm.c
index 5871374..0a6ea48 100644
--- a/src/eventcomm.c
+++ b/src/eventcomm.c
@@ -50,6 +50,9 @@
#ifndef INPUT_PROP_SEMI_MT
#define INPUT_PROP_SEMI_MT 0x03
#endif
+#ifndef INPUT_PROP_TOPBUTTONPAD
+#define INPUT_PROP_TOPBUTTONPAD 0x04
+#endif
#ifndef ABS_MT_TOOL_Y
#define ABS_MT_TOOL_Y 0x3d
#endif
@@ -802,6 +805,11 @@ event_query_touch(InputInfoPtr pInfo)
xf86IDrvMsg(pInfo, X_INFO, "found clickpad property\n");
para->clickpad = TRUE;
}
+
+ if (libevdev_has_property(dev, INPUT_PROP_TOPBUTTONPAD)) {
+ xf86IDrvMsg(pInfo, X_INFO, "found top buttonpad property\n");
+ para->has_secondary_buttons = TRUE;
+ }
#endif
diff --git a/src/properties.c b/src/properties.c
index 4c75797..718d054 100644
--- a/src/properties.c
+++ b/src/properties.c
@@ -176,6 +176,9 @@ InitSoftButtonProperty(InputInfoPtr pInfo)
prop_softbutton_areas =
InitAtom(pInfo->dev, SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 8, values);
+ if (!para->has_secondary_buttons)
+ return;
+
values[0] = para->softbutton_areas[TOP_RIGHT_BUTTON_AREA][LEFT];
values[1] = para->softbutton_areas[TOP_RIGHT_BUTTON_AREA][RIGHT];
values[2] = para->softbutton_areas[TOP_RIGHT_BUTTON_AREA][TOP];
diff --git a/src/synaptics.c b/src/synaptics.c
index 118d1c6..b25c902 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -674,6 +674,10 @@ set_default_parameters(InputInfoPtr pInfo)
pars->tap_time_2 = xf86SetIntOption(opts, "MaxDoubleTapTime", 180);
pars->click_time = xf86SetIntOption(opts, "ClickTime", 100);
pars->clickpad = xf86SetBoolOption(opts, "ClickPad", pars->clickpad); /* Probed */
+ if (pars->clickpad)
+ pars->has_secondary_buttons = xf86SetBoolOption(opts,
+ "HasSecondarySoftButtons",
+ pars->has_secondary_buttons);
pars->clickpad_ignore_motion_time = 100; /* ms */
/* middle mouse button emulation on a clickpad? nah, you're joking */
middle_button_timeout = pars->clickpad ? 0 : 75;
@@ -777,7 +781,8 @@ set_default_parameters(InputInfoPtr pInfo)
}
set_primary_softbutton_areas_option(pInfo);
- set_secondary_softbutton_areas_option(pInfo);
+ if (pars->has_secondary_buttons)
+ set_secondary_softbutton_areas_option(pInfo);
}
static double
diff --git a/src/synapticsstr.h b/src/synapticsstr.h
index b8a3492..4bd32ac 100644
--- a/src/synapticsstr.h
+++ b/src/synapticsstr.h
@@ -176,6 +176,7 @@ typedef struct _SynapticsParameters {
int tap_time_2; /* max. tapping time for double taps */
int click_time; /* The duration of a single click */
Bool clickpad; /* Device is a has integrated buttons */
+ Bool has_secondary_buttons; /* Device has a top soft-button area */
int clickpad_ignore_motion_time; /* Ignore motion for X ms after a click */
int emulate_mid_button_time; /* Max time between left and right button presses to
emulate a middle button press. */