summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2016-08-05touchpad: use the udev ID_INPUT_TOUCHPAD_INTEGRATION property if availablePeter Hutterer1-0/+18
udev now labels touchpads as "internal" or "external" for us, use that value where available and only fall back onto our own labelling if it's missing or unknown. systemd commit: https://github.com/systemd/systemd/pull/3638 https://bugs.freedesktop.org/show_bug.cgi?id=96735 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 64e39411892fa4897f6e018daaa2de2ffaf8b671)
2016-08-05evdev: prefix "tablet unknown to libwacom" error with the device namePeter Hutterer1-1/+3
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 45a574a7859cb83e589c6f2d33d81a3f666ba60d)
2016-07-18touchpad: change offset ints to device_coordsPeter Hutterer1-15/+15
No functional changes, just makes the unit more explicit Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-07-18evdev: constify evdev_device_get_sizePeter Hutterer2-2/+2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-07-15touchpad: don't init a horizontal scroll area on touchpads <50mm highPeter Hutterer1-1/+17
We simply don't have enough space on those touchpads to have an area carved out for horizontal scrolling. Given that horizontal scrolling is rarely needed anyway users of these touchpads will just have to cling to scroll bars or use two-finger scrolling. Exception are small clickpads because they already have an area blocked off for software buttons and those small clickpads generally come from a time when clickfinger wasn't much of a thing yet. https://bugs.freedesktop.org/show_bug.cgi?id=96910 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-07-14touchpad: reduce middle button size on Dell touchpads to 10mmPeter Hutterer3-3/+23
All Dell touchpas appear to have a visual marker on their touchpads. With a visible marker our middle button can (and should) be much smaller since we can rely on users to hit the button precisely. https://bugs.freedesktop.org/show_bug.cgi?id=96710 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Tested-by: Andy Lutomirski <luto@kernel.org> Reviewed-by: Yong Bakos <ybakos@humanoriented.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-07-13touchpad: drop unused argument diagonal from tp_init_accelPeter Hutterer1-4/+2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-07-13tablet: catch potential segfault if the filter fails to allocatePeter Hutterer1-0/+2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-07-13Fix some indentation issuesPeter Hutterer1-5/+5
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-07-11Remove LIBINPUT_EVENT_TABLET_PAD_MODE eventPeter Hutterer2-15/+0
Unimplemented and it wasn't supposed to be in the series. https://lists.freedesktop.org/archives/wayland-devel/2016-June/029376.html Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Carlos Garnacho <carlosg@gnome.org>
2016-07-11Fix and improve mode group documentationPeter Hutterer1-18/+29
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-07-04Merge branch 'wip/tablet-pad-modes-v3'Peter Hutterer10-151/+952
2016-07-04touchpad: remove software middle button when emulation is enabledPeter Hutterer6-5/+111
Expose the middle button emulation on software buttons as proper config option. When enabled, remove the middle button software button area. https://bugs.freedesktop.org/show_bug.cgi?id=96663 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-07-04evdev: return the desired middle button emulation statePeter Hutterer1-1/+1
Middle button emulation may be delayed in turning on, but during that delay we already need to return the desired state. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-07-04touchpad: unify internal/external touchpad taggingPeter Hutterer3-20/+55
To unify this we need to move the tagging process forward so tp_init() can rely on it for config setup. This means moving it to the touchpad init code. Other than that no real functional changes, the rules stay the same: * serial/i2c/etc. are considered internal touchpads * Bluetooth is always external * USB is external for Logitech devices * USB is external for Wacom devices * USB is internal for Apple touchpads And if we can't figure it out, we assume it's external and log a message so we can put a quirk in place. https://bugs.freedesktop.org/show_bug.cgi?id=96735 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-07-04gestures: make the gesture movement threshold depending on finger countPeter Hutterer1-3/+6
Increase the mm move threshold for 3 and 4 finger gestures to 2 and 3 mm, respectively. In multi-finger gestures it's common to have minor movement while all fingers are being put down or before the conscious movement starts. This can trigger invalid gesture detection (e.g. a pinch instead of a swipe). Increase the movement threshold to make sure we have sufficient input data. No changes to 2-finger movements. https://bugs.freedesktop.org/show_bug.cgi?id=96687 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-06-29touchpad: only check for vertical finger distribution on 2fg gesturesPeter Hutterer1-12/+13
A natural hand position for a 4-finger swipe will have one finger well below the other triggering the pinch detection. This is obviously wrong, only do the finger position analysis when we have 2 fingers. This is only a partial fix, for 3-4 finger gestures chances are high that the third/fourth finger come in a different event frame. Before that we likely detect 2 fingers in a possible pinch position and still trigger the code path. This issue has to be fixed separately. https://bugs.freedesktop.org/show_bug.cgi?id=96687 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-06-28tablet: make the cursor/lens tool behave like a 1000dpi mousePeter Hutterer2-20/+79
The current code tried to emulate the relative motion to be equivalent to the absolute motion, except in screen coordinates. This is way too slow for the cursor tool that we want to behave like a mouse. Tablets have high resolution (e.g. an Intuos 4 is a 5080dpi mouse) and that motion is way too fast to be usable. Scale it down to match a 1000dpi device instead. Since the cursor and lens tool are still high precision devices leave them in a flat acceleration profile without actual acceleration. For the stylus-like devices leave the current accel, pointer acceleration on a stylus is hard to handle. This also adds the missing bits for actually using the speed factor set through the config interface. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com> Reviewed-by: Carlos Garnacho <carlosg@gnome.org>
2016-06-24pad: implement basic mode group support (1 group with 1 mode)Peter Hutterer8-22/+357
Until the kernel patches to handle LED group switching are in place we provide the external API backed by an implementation that simply exposes one group with one mode and no toggle buttons. This allows us to ship a libinput release with the API in place and switch libinput later without having all the stack above us being delayed. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Carlos Garnacho <carlosg@gnome.org>
2016-06-22pad: Add a new API for modes and mode groupsPeter Hutterer4-0/+438
Move mode control to libinput. This reduces some flexibility on what we can do with modes but makes it a lot easier for anyone to implement modes correctly and have the LEDs apply appropriately, etc. Let's go with the option to make the 95% use-case easy. Note: whether the mode is actually used is up to the caller, e.g. under Windows and OS X the mode only applies to the rings/strips, not the buttons. A tablet pad has 1 or more mode groups, all buttons/ring/strips are assigned to a mode group. That group has a numeric mode index and is hooked to the LEDs. libinput will switch the LEDs accordingly. The mode group is a separate object. This allows for better APIs when it comes to: * checking whether a button/ring/strip is part of a mode group * checking whether a button will trigger a mode transition and in the future potentially: * checking which mode transition will happen * setting which button should change the mode transition * changing what type of mode transition should happen. * moving a button from one mode group to the other This patch adds the basic scaffolding, without any real implementation. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Proofread-by: Yong Bakos <ybakos@humanoriented.com> Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com> Reviewed-by: Carlos Garnacho <carlosg@gnome.org>
2016-06-22doc: move the struct declarations to the topPeter Hutterer1-126/+126
They don't define anything, move them to the top so we don't have ordering requirements of the stuff that actually uses those as parameters. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Yong Bakos <ybakos@humanoriented.com> Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com> Reviewed-by: Carlos Garnacho <carlosg@gnome.org>
2016-06-22doc: split the tablet pad events into their own doxygen module pagePeter Hutterer1-15/+23
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Yong Bakos <ybakos@humanoriented.com> Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com> Reviewed-by: Carlos Garnacho <carlosg@gnome.org>
2016-06-22util: add safe_atoi helper functionPeter Hutterer1-0/+20
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com> Reviewed-by: Carlos Garnacho <carlosg@gnome.org>
2016-06-20Merge branch 'wip/touchpad-drop-hysteresis'Peter Hutterer4-15/+0
2016-06-20touchpad: re-enable hysteresis by default for all devicesPeter Hutterer3-8/+0
The removal of the hysteresis even on precise touchpads has led to difficulties controlling the cursor in a few instances. Since 27078b2667d we only have the hysteresis on Apple touchpads and the Lenovo *40 series and later. Even on those do we see some positioning difficulties (bug 94379). So restore the hysteresis by default again for all touchpads. In the future a knob could be exposed for precision vs reactivity or something, but for now the drawback of imprecise positioning does not outweigh the benefits we get on those few devices. https://bugs.freedesktop.org/show_bug.cgi?id=94379 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-06-20Revert "touchpad: reset the motion history on significant negative pressure ↵Peter Hutterer2-5/+0
changes" We will reinstate the hysteresis for all devices making the negative pressure check unncessary. This reverts commit ef48c07a9600733e068a2a437a145862ba07fdab. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-06-20Revert "touchpad: only use negative pressure change check on Lenovo *50 and ↵Peter Hutterer1-3/+1
*60 series" We will reinstate the hysteresis for all devices making the negative pressure check unncessary and thus this commit as well. This reverts commit 2f5231cc88fccf389a78270d827f6c9201b86794. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-06-20test: add an apple magicmouse devicePeter Hutterer2-0/+8
This device has a touchpad on the mouse but it's labeled as mouse. For litest we only label it as LITEST_MOUSE feature and test the touchpad directly on the device. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-06-15touchpad: stop palm detection when a second finger is detectedPeter Hutterer1-5/+41
This avoids accidental palm detection during two-finger scrolling if one finger is inside the edge exclusion zone. Palm detection is designed to avoid accidental touches while typing. If a non-palm finger is on the touchpad already the user is unlikely to be typing. So stop palm detection in this case and process the fingers as normal. This implementation has a minor bug: if both palm touches start within the palm exclusion zone within the same frame, neither will be labelled as palm due to how we check the other touches. Since this is an extremeley niche case we can live with that. https://bugs.freedesktop.org/show_bug.cgi?id=95417 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-06-15touchpad: split palm movement detection into a helper functionPeter Hutterer1-12/+23
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-06-13touchpad: don't warn about kernel jumps on semi-mt devicesPeter Hutterer1-4/+5
These devices are all over the place anyway, no need to spam the log, just silently discard the jumps. https://bugs.freedesktop.org/show_bug.cgi?id=96275 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-06-10pad: add helper function to access the libinput contextPeter Hutterer2-3/+9
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-06-10tablet: add helper function to access the libinput contextPeter Hutterer2-15/+22
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-06-10evdev: add helper to get the libinput context from the evdev devicePeter Hutterer5-34/+38
And change the various callers, especially those where we only had the separate struct for indentation purposes. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-06-10touchpad: use the tp_libinput_context() helperPeter Hutterer2-4/+4
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-06-10evdev: check model flags for actual booleansPeter Hutterer1-2/+4
The hwdb doesn't allow unsetting a property so once we start nesting model flags it'll become important to be able to be able to unset one as well (by assigning it to 0). So rather than checking for existence, check whether the property is actually set to something resembling a boolean. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Tested-by: Vasily Khoruzhick <anarsoul@gmail.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-06-08pad: change button map orderingPeter Hutterer1-2/+2
BTN_A and above sort after BTN_BASE Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-06-08pad: group the button state into a private structPeter Hutterer1-6/+8
This is only set on button events so use the same approach as for rings and strips. No functional changes. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
2016-06-06touchpad: restore the hysteresis by defaultPeter Hutterer3-15/+5
A large part of the bugs seen right now are related to touchpads jittering too much. Fixing them one by one is entertaining, but time consuming. Right now the number of touchpads that require a hysteresis seem to outnumber those that don't, so switch the approach around: leave the hysteresis in place but disable it for those touchpads that don't need it. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-06-02touchpad: warn if we have invalid touchpad rangesPeter Hutterer2-0/+64
Quite a few bugs are caused by touchpad ranges being out of whack. If we get input events significantly outside the expected range (5% width/height as error margin) print a warning to the log. And add a new doc page to explain what is happening and how to fix it. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-06-01touchpad: short-circuit the edge scroll handling when it's not enabledPeter Hutterer1-3/+9
No need to handle events properly in the edge scroll state machine when it's not enabled. Just set any beginning touch to state AREA and move on. The rest of the code guarantees neutral state when edge scrolling is enabled or disabled. This reduces the debug output produced by libinput-debug-events when edge scrolling is disabled, preventing users from seemingly identifying bugs where there are none. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-05-30tablet: up the reference count for the tool in the eventPeter Hutterer1-4/+22
Make sure that the tool is valid while the event is valid, even if the device gets destroyed before the event is destroyed. This cannot actually be triggered right now, the event has a ref to the device and the tools do not get removed until the device is destroyed. But for future implementations (e.g. where the tool is otherwise automatically destroyed on proximity out) we need to ensure the tool remains valid for the event lifetime. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-30touchpad: fix link in error message - add missing '.html'Peter Hutterer1-1/+1
https://bugs.freedesktop.org/show_bug.cgi?id=96191 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-27pad: ignore EV_MSC eventsPeter Hutterer1-0/+4
The Wacom Express Key Remote sends the serial number via EV_MSC. At some later point we'll need the serial to match the LEDs correctly but for now we can ignore them. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-24doc: update ref/unref behavior for the tablet toolPeter Hutterer1-4/+7
Brings it in line with the rest of libinput. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-24doc: update doc to explicitly state that the seat isn't referencedPeter Hutterer1-0/+5
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-23Drop the ALPS_RUSHMORE tagPeter Hutterer3-5/+0
Was only used for the touchpad hysteresis, we can re-use the wobbly touchpad tag for this. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-05-19doc: fix a few typosPeter Hutterer1-2/+3
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-19touchpad: disable cursor jump detection for Wacom tabletsPeter Hutterer1-0/+6
We haven't seen jumps on Wacom tablets yet and they cause error messages in most of the tests. litest uses a scaling approach for most events, so a finger move that moves from 30% to 80% of the touchpad with can easily trigger a jump on a Wacom tablet due to its physical size. Rather than having to fix up all tests for the larger size (and potentially cover some other bugs) simply disable this test for Wacom tablets. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-05-18touchpad: only use negative pressure change check on Lenovo *50 and *60 seriesPeter Hutterer1-1/+3
This was introduced for bug 94379 - an X1 Carbon 3rd. Other touchpads have different pressure change ranges, causing this condition to trigger randomly and resulting in a jerky pointer motion. For now, reduce the check to the *50 and *60 series touchpads until we have data for more touchpads that we can add one-by-one. https://bugs.freedesktop.org/show_bug.cgi?id=95393 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>