[PATCH xf86-input-synaptics 03/12] Add clickpad timeout property
Peter Hutterer
peter.hutterer at who-t.net
Wed Feb 22 19:58:23 PST 2012
On Thu, Feb 09, 2012 at 06:52:57PM -0800, Chase Douglas wrote:
> Signed-off-by: Chase Douglas <chase.douglas at canonical.com>
> ---
> include/synaptics-properties.h | 3 +++
> man/synaptics.man | 12 ++++++++++++
> src/properties.c | 9 +++++++++
> src/synaptics.c | 1 +
> src/synapticsstr.h | 1 +
> 5 files changed, 26 insertions(+), 0 deletions(-)
>
> diff --git a/include/synaptics-properties.h b/include/synaptics-properties.h
> index 140f14b..712a10b 100644
> --- a/include/synaptics-properties.h
> +++ b/include/synaptics-properties.h
> @@ -51,6 +51,9 @@
> /* 8 bit (BOOL) */
> #define SYNAPTICS_PROP_CLICKPAD "Synaptics ClickPad"
>
> +/* 32 bit */
> +#define SYNAPTICS_PROP_CLICKPAD_TIMEOUT "Synaptics ClickPad Timeout"
> +
> /* 8 bit (BOOL) */
> #define SYNAPTICS_PROP_TAP_FAST "Synaptics Tap FastTap"
>
> diff --git a/man/synaptics.man b/man/synaptics.man
> index 8edc2f0..9721038 100644
> --- a/man/synaptics.man
> +++ b/man/synaptics.man
> @@ -149,6 +149,14 @@ into the touchpad surface. The user must press downward on the touchpad in order
> to generated a button press. This property may be set automatically if a click
> pad device is detected at initialization time. Property: "Synaptics ClickPad"
> .TP 7
> +.BI "Option \*qClickPadTimeout\*q \*q" integer \*q
> +Maximum time (in milliseconds) for a press-release action on a clickpad device.
> +When the user presses a clickpad device for more than this time, the driver
this is unclear. does "press" refer to a press down of the pad or a simple
finger-press?
the commit message should state that this isn't connected to anything yet.
Cheers,
Peter
> +interprets the action as a left button press. If the user releases the button
> +before this timeout, a click action is performed. See the ClickFinger options or
> +the "Synaptics Click Action" property for details. Property: "Synaptics ClickPad
> +Timeout"
> +.TP 7
> .BI "Option \*qFastTaps\*q \*q" boolean \*q
> Makes the driver react faster to a single tap, but also makes double
> clicks caused by double tapping slower. Property: "Synaptics Tap FastTap"
> @@ -795,6 +803,10 @@ duration of a single click.
> 8 bit (Bool).
>
> .TP 7
> +.BI "Synaptics ClickPad Timeout"
> +32 bit.
> +
> +.TP 7
> .BI "Synaptics Tap FastTap"
> 8 bit (BOOL).
>
> diff --git a/src/properties.c b/src/properties.c
> index 38f21b2..f1bda8e 100644
> --- a/src/properties.c
> +++ b/src/properties.c
> @@ -59,6 +59,7 @@ Atom prop_tap_time = 0;
> Atom prop_tap_move = 0;
> Atom prop_tap_durations = 0;
> Atom prop_clickpad = 0;
> +Atom prop_clickpad_timeout = 0;
> Atom prop_tap_fast = 0;
> Atom prop_middle_timeout = 0;
> Atom prop_twofinger_pressure = 0;
> @@ -192,6 +193,9 @@ InitDeviceProperties(InputInfoPtr pInfo)
> prop_tap_durations = InitAtom(pInfo->dev, SYNAPTICS_PROP_TAP_DURATIONS, 32, 3, values);
> prop_clickpad = InitAtom(pInfo->dev, SYNAPTICS_PROP_CLICKPAD, 8, 1,
> ¶->clickpad);
> + prop_clickpad_timeout = InitAtom(pInfo->dev,
> + SYNAPTICS_PROP_CLICKPAD_TIMEOUT, 32, 1,
> + ¶->clickpad_timeout);
> prop_tap_fast = InitAtom(pInfo->dev, SYNAPTICS_PROP_TAP_FAST, 8, 1, ¶->fast_taps);
> prop_middle_timeout = InitAtom(pInfo->dev, SYNAPTICS_PROP_MIDDLE_TIMEOUT,
> 32, 1, ¶->emulate_mid_button_time);
> @@ -400,6 +404,11 @@ SetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop,
> return BadMatch;
>
> para->clickpad = *(BOOL*)prop->data;
> + } else if (property == prop_clickpad_timeout) {
> + if (prop->size != 1 || prop->format != 32 || prop->type != XA_INTEGER)
> + return BadMatch;
> +
> + para->clickpad_timeout = *(INT32*)prop->data;
> } else if (property == prop_tap_fast)
> {
> if (prop->size != 1 || prop->format != 8 || prop->type != XA_INTEGER)
> diff --git a/src/synaptics.c b/src/synaptics.c
> index 2891784..071eaed 100644
> --- a/src/synaptics.c
> +++ b/src/synaptics.c
> @@ -535,6 +535,7 @@ static void set_default_parameters(InputInfoPtr pInfo)
> pars->tap_time_2 = xf86SetIntOption(opts, "MaxDoubleTapTime", 180);
> pars->click_time = xf86SetIntOption(opts, "ClickTime", 100);
> pars->clickpad = xf86SetIntOption(opts, "ClickPad", pars->clickpad); /* Probed */
> + pars->clickpad_timeout = xf86SetIntOption(opts, "ClickPadTimeout", 500);
> pars->fast_taps = xf86SetBoolOption(opts, "FastTaps", FALSE);
> pars->emulate_mid_button_time = xf86SetIntOption(opts, "EmulateMidButtonTime", 75);
> pars->emulate_twofinger_z = xf86SetIntOption(opts, "EmulateTwoFingerMinZ", emulateTwoFingerMinZ);
> diff --git a/src/synapticsstr.h b/src/synapticsstr.h
> index 8f33b95..140bcf0 100644
> --- a/src/synapticsstr.h
> +++ b/src/synapticsstr.h
> @@ -126,6 +126,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 */
> + int clickpad_timeout; /* Timeout for button pad press to click-and-drag */
> Bool fast_taps; /* Faster reaction to single taps */
> int emulate_mid_button_time; /* Max time between left and right button presses to
> emulate a middle button press. */
> --
> 1.7.8.3
>
More information about the xorg-devel
mailing list