summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2016-02-18touchpad: move the tapping exclusion zone to the top edge of the buttonPeter Hutterer2-8/+4
We previously used the half-way mark of the touchpad's y axis to decide where to ignore tapping. Move this down to the top edge of the software buttons instead. Users may tap with a finger in the software button areas, on the rest of the touchpad it's unlikely that they tap within 5% of the edge. On touchpads with physical buttons or if clickfinger is enabled, the no-tapping zone extends to the bottom of the touchpad. This required splitting the tests into clickfinger, softbuttons and hardbuttons. https://bugs.freedesktop.org/show_bug.cgi?id=93947 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-02-18touchpad: add synaptics semi-mt devices to those needing hysteresisPeter Hutterer1-8/+19
https://bugs.freedesktop.org/show_bug.cgi?id=94097 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-02-11test: add tablet test for out-of-bounds motion coordinatesPeter Hutterer1-0/+12
The newer Cintiqs have a minimum value of 400/400 advertised by the kernel but the actual sensor goes past the 0/0 origin. Test this, make sure that a value outside the boundaries generates negative mm values. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-10tablet: move left-handed initialization into tablet_initPeter Hutterer1-33/+33
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-10tablet: fix artpen rotation on left-handed tabletsPeter Hutterer1-0/+2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-10test: add test for left-handed mouse rotation on tabletsPeter Hutterer1-0/+2
Should be offset by 180 degrees Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-10tablet: move clearing the tilt bits up to where we reset the axesPeter Hutterer1-2/+2
No functional change. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-10tablet: delay initial proximity in event until we have a serialPeter Hutterer1-7/+5
If the tablet is already in proximity on startup, we used to immediately sent a proximity event. We can't fetch MSC_SERIAL from the kernel, so that tool always had a serial of 0, followed by events with the real serial. Since clients are supposed to use the serial for the tracking of tools, this is suboptimal. When the tablet is added, merely set the internal proximity flags. This way we wait until the first real event from the device (which includes the serial number) and convert that into a proximity event. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-10touchpad: init a default hysteresis for ALPS rushmore touchpadsPeter Hutterer3-1/+4
https://bugs.freedesktop.org/show_bug.cgi?id=90590 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-02-09tablet: change tilt axes to use degreesPeter Hutterer3-11/+33
The Wacom tilt range is 64 degrees so we map everything into that until we know otherwise. This commit also switches the tilt axes around to align the angles with the x/y orientation, i.e. tilting the top of the stylus towards the positive x axis now generates a positive x tilt. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
2016-02-09touchpad: fix dwt disabling while a key is still downPeter Hutterer1-4/+5
If dwt is disabled on the commandline, e.g. by setting an xinput property it may be disabled before the release event comes in. This caused the timer to refresh indefinitely since the key state mask was still on for that key. Always updating the key state mask (even when dwt is disabled) fixes that. If a key is held down while dwt is disabled, this can still cause a indefinite timer refresh, so in the timer func, check if dwt is enabled before refreshing the timer. https://bugs.freedesktop.org/show_bug.cgi?id=94015 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-02-05Indentation fixesPeter Hutterer1-3/+3
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-05touchpad: if we have a serio keyboard, override any previous dwt pairingPeter Hutterer1-14/+34
If a USB keyboard like the YubiKey is found before the internal keyboard, it will be paired with the touchpad when it is seen. The internal keyboard is seen later bug ignored because we already have a keyboard paired with the touchpad. This is obviously wrong. For now, give priority to serio keyboards, and override existing dwt pairings with the new keyboard. https://bugs.freedesktop.org/show_bug.cgi?id=93983 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-02-05touchpad: while a key is held down, don't disable dwtPeter Hutterer3-2/+31
If a key enables dwt and is held down when the timeout expires, re-issue the timeout. There is a corner case where dwt may not work as expected: 1. key down and held down 2. dwt timer expires, dwt is re-issued 3. touch starts 4. key is released 5. dwt timer expires 6. touch now starts moving the pointer This is an effect of the smart touch detection. A touch starting after the last key press is released for pointer motion once dwt turns off again. This is what happens in the above case, the dwt timer expiring is the last virtual key press. This is a corner case and likely hard to trigger by a real user. https://bugs.freedesktop.org/show_bug.cgi?id=93984 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-02-04touchpad: drop motion hysteresis by defaultPeter Hutterer3-5/+20
Some older touchpad devices jitter a fair bit when a finger is resting on the touchpad. That's why the hysteresis was introduced in the synaptics driver back in 2011. However, the default value of the hysteresis in the synaptics driver ended up being 0, even though the code looks like it's using a fraction of the touchpad diagonal. When the hysteresis code was ported to libinput it was eventually set to 0.5mm. Turns out this is still too high and tiny finger motions are either nonreactive or quite jumpy, making it hard to select small targets. Drop the default hysteresis by reducing its margin to 0, but leave it in place for those devices where we need them (e.g. the cyapa touchpads). https://bugs.freedesktop.org/show_bug.cgi?id=93503 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-02-04tablet: change error message to TABLET_TOOL from TABLETPeter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-04doc: be more specific about tablet vs tablet toolPeter Hutterer1-61/+63
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-01evdev: disable the mode button on the Cyborg RAT 5Peter Hutterer2-0/+37
This button sends a release N, press N+1 on each press, cycling through the three event codes supported. This causes a stuck button since the current mode is never released. Long-term this better served by a set of switches that toggle accordingly, for now disable the button codes. https://bugs.freedesktop.org/show_bug.cgi?id=92127 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-01-27Prepare tablet-support branch for mergingPeter Hutterer1-6/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-01-27Merge branch 'master' into tablet-supportPeter Hutterer6-4/+171
2016-01-27touchpad: add a config option to disable tap-and-dragPeter Hutterer6-3/+170
There are a number of use-cases where tapping may be desirable, but tap-and-drag is not, e.g. where tapping is used to select multiple items in a list. Having tap-and-drag on hinders this, and the nature of the interaction means it cannot be detected based on timeouts, movement thresholds, etc. Provide an option instead to turn tap-an-drag off. Tap-and-drag remains enabled by default (though tapping is disabled by default). For the touchpad tap state diagram, the new option disables the transition from state TOUCH to state TAPPED and releases the button immediately instead. This means that multitap-and-drag is disabled too since we now just loop around in the single-tap state for multitap. It also makes tapping more responsive - we don't have to wait for the timeout before we know whether it's a tap event. The first touch time is noted, we now send the button press with the time of the first touch and the release with the time of the release. This ensures a realistic time diff between the two events. https://bugs.freedesktop.org/show_bug.cgi?id=93502 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.netto> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-01-27gestures: average motion by active touches, not moved touchesPeter Hutterer1-6/+10
When two fingers move slowly, an event frame may only have one finger motion, followed by a frame with the other finger's motion. If we only divide by the number of dirty touches, the speed of the gesture increases whenever that happens. Reported-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-01-25Merge branch 'master' into tablet-supporttablet-supportPeter Hutterer8-213/+295
2016-01-25gestures: average motion by active touches, not moved touchesPeter Hutterer1-6/+10
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-01-25gestures: jump straight to swipe for 3+ finger gestures on ST touchpadsPeter Hutterer1-2/+8
The first/second variables are only needed for pinch, so we can skip them here. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-01-25gestures: jump straight to swipe for 3+ finger gestures on ST touchpadsPeter Hutterer1-2/+8
The first/second variables are only needed for pinch, so we can skip them here. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-01-25touchpad: remove unused variablePeter Hutterer1-3/+0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-01-25Merge branch 'wip/disable-semi-mt-gestures'Peter Hutterer2-41/+27
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-01-25touchpad: remove unused field multitap_last_timePeter Hutterer2-2/+0
Unused since d92ae62dad53afd894a Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-01-22tablet: fix potential null-pointer dereferencePeter Hutterer1-0/+5
Found by coverity Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-01-22tablet: hook up relative motion eventsPeter Hutterer6-10/+230
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Jason Gerecke <jason.gerecke@wacom.com>
2016-01-22tablet: add support for relative x/y motion deltasPeter Hutterer4-0/+63
Instead of an explicit tablet mode that device must be changed into, let the caller decide which coordinates are preferred. The tablet mode may be application-specific and usually depends on the tool as well. This patch adds an interface to get a motion delta for the x/y axes in pixel-like coordinates. libinput provides some magic to convert the tablet data into something that resembles pixels from a mouse motion. For unaccelerated relative motion, the caller should use the mm values from the tablet and calculate deltas manually. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Jason Gerecke <jason.gerecke@wacom.com>
2016-01-22touchpad: disable gestures for single-finger touchpadsPeter Hutterer1-1/+1
No point trying to detect pinch gestures if we only have one set of coordinates. This makes two-finger scrolling on ST touchpads more reactive. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-01-22touchpad: disable MT for all semi-mt devicesPeter Hutterer2-40/+24
Synaptics, Elantech and Alps semi-mt devices all have issues with reporting correct MT data, even the bounding box which semi-mt devices are supposed to report is wrong. Synaptics devices have massive jumps with two fingers down. Elantech devices may open slots without coordinate data. Alps devices may send 0/0 coordinates as initial slot position. All these may be addressable with specific quirks, but the actual benefit is largely restricted to better palm detection (though even with quirks this is unlikely to work) and support for pinch gestures (again, lack of coordinates makes supporting those hard anyway). Elantech: https://bugs.freedesktop.org/show_bug.cgi?id=93583 Alps: https://bugzilla.redhat.com/show_bug.cgi?id=1295073 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-01-22touchpad: don't try to unhover touches if nothing changedPeter Hutterer1-0/+3
If the touch hasn't updated, the distance hasn't changed so there is no need to unhover. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-01-20Merge branch 'wip/3-finger-pinch-gesture'Peter Hutterer8-164/+255
2016-01-20gestures: if a finger is 20mm below the other one, assume a pinch gesturePeter Hutterer1-5/+21
Pure movement detection is quite unreliable when trying 3-finger pinch gestures, and many gestures are misdetected as swipes. Before looking at the motion, look at the constellation of the fingers. If one finger is 20mm below the other one, assume they're in a pinch position. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-01-20gestures: add support for three-finger pinch gesturesPeter Hutterer2-81/+123
https://bugs.freedesktop.org/show_bug.cgi?id=92834 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-01-20touchpad: check fake finger count for validityPeter Hutterer1-0/+8
Setting TRIPLETAP unsets DOUBLETAP, etc. This doesn't usually happen with kernel devices, but every once in a while I get this wrong in a test and spend hours debugging the code... Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-01-20gestures: pass the finger count into pinch eventsPeter Hutterer3-3/+10
Prep work for multifinger pinch gestures Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-01-20touchpad: constify a couple of helper functionsPeter Hutterer6-23/+36
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-01-20gestures: drop 2fg naming from the various statesPeter Hutterer2-51/+51
When adding 3+ finger gestures, there isn't much specific state left that's 2-finger only. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-01-20gestures: split direction check out into a helper functionPeter Hutterer1-13/+18
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-01-19Merge branch 'master' into tablet-supportPeter Hutterer6-41/+35
2016-01-18touchpad: drop the model detection - write-only valuePeter Hutterer2-37/+0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-01-15tablet: drop delta array, provided by the tablet_axis struct nowPeter Hutterer3-7/+3
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Jason Gerecke <jason.gerecke@wacom.com>
2016-01-15tablet: use a struct rather than a double array for axis valuesPeter Hutterer4-174/+161
Makes the code less generic, but more expressive. No visible functional changes. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Jason Gerecke <jason.gerecke@wacom.com>
2016-01-15tablet: allow the various get_<axis> on tablet button eventsPeter Hutterer2-9/+30
There's no reason to prevent this for button events. Unlike the pointer which is a relative device a tablet is (usually) a device with a lot of state. Caller code that handles axes is likely shared between the various events, treating button events separately here doesn't get us any benefit. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Jason Gerecke <jason.gerecke@wacom.com>
2016-01-14touchpad: disable MT for elantech semi-mt touchpadsPeter Hutterer1-1/+2
When three fingers are set down on the touchpad, one finger tends to get a 0/0 coordinate, triggering palm detection in the upper left corner. Handle this like the jumping semi-mt touchpads and disable MT handling and instead just rely on the x/y axis and the BTN_TOOL_* events. https://bugs.freedesktop.org/show_bug.cgi?id=93583 This kernel patch is required: https://lkml.org/lkml/2016/1/11/171 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-01-13touchpad: whitespace fixPeter Hutterer1-0/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>