Index: sys/dev/atkbdc/psm.c =================================================================== --- sys/dev/atkbdc/psm.c (revision 200181) +++ sys/dev/atkbdc/psm.c (working copy) @@ -343,6 +343,9 @@ #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 @@ } } + /* + * 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) { + /* + * 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 { + /* + * 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 @@ 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"); Index: share/man/man4/psm.4 =================================================================== --- share/man/man4/psm.4 (revision 200181) +++ share/man/man4/psm.4 (working copy) @@ -359,6 +359,18 @@ This will enable .Nm to handle packets from guest devices (sticks) and extra buttons. +.Pp +Tap and drag gestures can be disabled by setting +.Va hw.psm.tap_enabled +to +.Em 0 +at boot-time. +Currently, this is only supported on Synaptics touchpads with Extended +support disabled. The behaviour may be changed after boot by setting +the sysctl with the same name and by restarting +.Xr moused 8 +using +.Pa /etc/rc.d/moused . .Sh IOCTLS There are a few .Xr ioctl 2