diff options
author | dumbbell <dumbbell@FreeBSD.org> | 2009-12-18 17:46:57 +0000 |
---|---|---|
committer | dumbbell <dumbbell@FreeBSD.org> | 2009-12-18 17:46:57 +0000 |
commit | f296f6d5cdf0321149115ab1310e55997371c64f (patch) | |
tree | 6f122cd1405c753a8f7d42bd37767e321c86618f /sys/dev/atkbdc | |
parent | 2b342a7429a69cc98f2bc39ed4b8ca5f06b094c8 (diff) | |
download | FreeBSD-src-f296f6d5cdf0321149115ab1310e55997371c64f.zip FreeBSD-src-f296f6d5cdf0321149115ab1310e55997371c64f.tar.gz |
Add new "hw.psm.tap_enabled" tunable and sysctl.
This tunable allows one to enable (1) or disable (0) gestures like tap
and tap-hold on Synaptics TouchPad when the Extended mode isn't enabled
(ie. "hw.psm.synaptics_support" not set).
By default, the value is -1 in order to keep the current behaviour of
not enabling/disabling gestures explicitly.
PR: kern/139272
Submitted by: David Horn <dhorn2000 AT gmail DOT com>
Reviewed by: David Horn <dhorn2000 AT gmail DOT com>
Diffstat (limited to 'sys/dev/atkbdc')
-rw-r--r-- | sys/dev/atkbdc/psm.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/sys/dev/atkbdc/psm.c b/sys/dev/atkbdc/psm.c index 93c9acb..30113bd 100644 --- a/sys/dev/atkbdc/psm.c +++ b/sys/dev/atkbdc/psm.c @@ -343,6 +343,9 @@ static devclass_t psm_devclass; #define PSM_FLAGS_FINGERDOWN 0x0001 /* VersaPad finger down */ /* Tunables */ +static int tap_enabled = -1; +TUNABLE_INT("hw.psm.tap_enabled", &tap_enabled); + static int synaptics_support = 0; TUNABLE_INT("hw.psm.synaptics_support", &synaptics_support); @@ -901,6 +904,36 @@ doopen(struct psm_softc *sc, int command_byte) } } + /* + * A user may want to disable tap and drag gestures on a Synaptics + * TouchPad when it operates in Relative Mode. + */ + if (sc->hw.model == MOUSE_MODEL_GENERIC) { + if (tap_enabled > 0) { + /* + * Enable tap & drag gestures. We use a Mode Byte + * and clear the DisGest bit (see §2.5 of Synaptics + * TouchPad Interfacing Guide). + */ + VLOG(2, (LOG_DEBUG, + "psm%d: enable tap and drag gestures\n", + sc->unit)); + mouse_ext_command(sc->kbdc, 0x00); + set_mouse_sampling_rate(sc->kbdc, 20); + } else if (tap_enabled == 0) { + /* + * Disable tap & drag gestures. We use a Mode Byte + * and set the DisGest bit (see §2.5 of Synaptics + * TouchPad Interfacing Guide). + */ + VLOG(2, (LOG_DEBUG, + "psm%d: disable tap and drag gestures\n", + sc->unit)); + mouse_ext_command(sc->kbdc, 0x04); + set_mouse_sampling_rate(sc->kbdc, 20); + } + } + /* enable the mouse device */ if (!enable_aux_dev(sc->kbdc)) { /* MOUSE ERROR: failed to enable the mouse because: @@ -2261,6 +2294,8 @@ static int pkterrthresh = 2; SYSCTL_INT(_debug_psm, OID_AUTO, pkterrthresh, CTLFLAG_RW, &pkterrthresh, 0, "Number of error packets allowed before reinitializing the mouse"); +SYSCTL_INT(_hw_psm, OID_AUTO, tap_enabled, CTLFLAG_RW, &tap_enabled, 0, + "Enable tap and drag gestures"); static int tap_threshold = PSM_TAP_THRESHOLD; SYSCTL_INT(_hw_psm, OID_AUTO, tap_threshold, CTLFLAG_RW, &tap_threshold, 0, "Button tap threshold"); |