Commit graph

136 commits

Author SHA1 Message Date
Peter Hutterer
197bad1676 test: add Wacom Cintiq 24HD Pen
One test now gets close enough to 100% of the axis value that
ck_assert_double_lt() is not fine-grained enough. Switch to a direct x < 100.0
check.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-11 16:02:22 +10:00
Peter Hutterer
4392cb5796 Indentation fixes
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-05 15:39:58 +10:00
Peter Hutterer
0b0150e08d touchpad: if we have a serio keyboard, override any previous dwt pairing
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-05 07:43:25 +10:00
Peter Hutterer
e19d5d228c evdev: disable the mode button on the Cyborg RAT 5
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-02-01 08:37:41 +10:00
Peter Hutterer
ae41aa146d Merge branch 'master' into tablet-support 2016-01-27 13:54:00 +10:00
Peter Hutterer
cba2278c3a touchpad: add a config option to disable tap-and-drag
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-27 10:03:28 +10:00
Peter Hutterer
de3f1fa6fa Merge branch 'master' into tablet-support 2016-01-25 15:29:11 +10:00
Peter Hutterer
342bc51016 touchpad: disable MT for all semi-mt devices
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-22 11:50:45 +10:00
Peter Hutterer
91a568d1a1 Merge branch 'master' into tablet-support 2016-01-19 12:02:51 +10:00
Peter Hutterer
988cfda42c evdev: only reject devices with missing MT x/y if they're MT devices
A fake MT device may have ABS_MT_POSITION_X but not Y. In this case we don't
care, because we don't handle those axes anyway.

http://bugs.freedesktop.org/show_bug.cgi?id=93474

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-01-12 09:07:36 +10:00
Caibin Chen
b3f11180e3 touchpad: fix DWT pairing for Macbook Pro 2015
Label internal keyboards through the udev hwdb and only pair the internal
(usb) Apple touchpads with those keyboards labelled as such.

https://bugs.freedesktop.org/show_bug.cgi?id=93367

Co-authored-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-01-11 10:11:32 +10:00
Peter Hutterer
2f481ba4a2 tablet: handle custom proximity handling
For the puck/lens cursor tool we need to artificially reduce proximity
detection. These tools are usually used in a relative mode (i.e. like a mouse)
and thus require lifting and resetting the tool multiple times to move across
the screen. The tablets' distance detection goes too far, requiring the user
to lift the device several cm on every move. This is uncomfortable.

Introduce an artificial distance threshold for the devices with the default
value taken from the X.Org wacom driver. If a tool is in proximity but outside
of this range, fake proximity events accordingly.

If a button was pressed while we were out of range we discard that event and
send it later when we enter proximity again.

This is the simple implementation that only takes one proximity out value (the
one from the wacom driver) and applies it to all. Those devices that support a
button/lens tool and have a different default threshold are well out of date.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

[rebased, tests updated for new axis percentage behavior (8d76734f)]

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-12-23 09:15:36 +10:00
Peter Hutterer
aaac47d442 test: add litest_axis_set_value helper function
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-12-23 07:33:11 +10:00
Peter Hutterer
beee8403e9 test: move litest_assert_ macros and helpers up to the rest of the defines
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-12-21 10:55:36 +10:00
Peter Hutterer
aaea4a63ec tablet: add tilt tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-12-21 09:47:31 +10:00
Peter Hutterer
727d184230 test: change extra axes to take a percentage as well
And change them to doubles, we need more granularity when the range is only
0-100.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-12-14 07:44:57 +10:00
Peter Hutterer
7ea1c134e6 test: add the HUION PenTablet device
Tablet with pressure and proximity but no distance axis.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-12-11 10:53:06 +10:00
Stephen Chandler Paul
33981394aa test: Add litest_assert_double_*() macros
Converts two doubles to 24.8 fixed-width integers so assertions can be made with
doubles in tests

Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 9d96286a44)
2015-12-10 17:00:04 +10:00
Peter Hutterer
5074b59241 Merge branch 'master' into tablet-support 2015-11-24 15:18:47 +10:00
Peter Hutterer
a10e92849c tablet: rename libinput_event_tablet to libinput_event_tablet_tool
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-11-18 12:13:54 +10:00
Peter Hutterer
6f5d9902c8 tablet: hook up tip events
Behavior for axis events in the same event frame as the BTN_TOUCH is to
always send axis events before any tip state.
Behavior for button events in the same event frame as the BTN_TOUCH is to
order button events to happen when the tip is in proximity, i.e. after the tip
event on tip down and before the tip event on tip up.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-11-16 08:43:58 +10:00
Peter Hutterer
c914956211 test: add a device to check MOUSE_WHEEL_CLICK_ANGLE handling
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-11-09 16:06:26 +10:00
Peter Hutterer
38f20850e1 evdev: init pointer acceleration for any device with pointer cap and rel x/y
The Asus RoG Gladius exposes two event nodes, one mouse, one keyboard. The
keyboard node has REL_X/Y and REL_HWHEEL on top of the various key bits and
ABS_VOLUME.

The keyboard node does not have BTN_* set, udev tags this device as a
keyboard only, not as a pointer but we still initialize the pointer caps for
it because of the wheel.

When moving this mouse, some deltas (ca "1 in every 20") are sent through the
keyboard node, causing a crash because we never initialized pointer
acceleration.

https://bugzilla.redhat.com/show_bug.cgi?id=1275407

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-10-30 11:18:18 +10:00
Peter Hutterer
6bfc36f9cf Merge branch 'master' into tablet-support 2015-08-04 12:32:00 +10:00
Peter Hutterer
2dd1b3ead0 test: move the helper functions to the litest.h file
To avoid duplication

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-07-31 09:14:21 +10:00
Peter Hutterer
a7bd84a7ee Merge branch 'master' into tablet-support 2015-07-24 10:56:05 +10:00
Peter Hutterer
abed81f29b test: add a couple of basic gesture tests
3finger swipe, pinch and spread. While we expect the pinch/spread to have a
zero angle, the discrete coordinates we use cause some angle, but below 1
degree.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-15 14:48:52 +10:00
Peter Hutterer
9e705bf334 Merge branch 'master' into tablet-support 2015-07-14 13:13:11 +10:00
Peter Hutterer
cbaa79cfdb test: add an Elantech touchpad device
This is an old recording and predates properties. It's not a clickpad, we
assume INPUT_PROP_POINTER is set.
From: https://bugs.freedesktop.org/attachment.cgi?id=57154

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-13 09:11:28 +10:00
Peter Hutterer
55435a707f test: add an Apple Magic Trackpad test device
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-13 09:11:13 +10:00
Peter Hutterer
95089b77d4 Merge branch 'master' into tablet-support
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-08 13:50:24 +10:00
Andreas Pokorny
1309718c00 litest: floating point comparison macros
Adds the macros ck_assert_double_{eq,ne,lt,gt,le,ge} to compare double
values using a fixed tolerance value. The tolerance value is
picked based on the range of values to be expected by the libinput API.

Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-07 17:49:17 +10:00
Andreas Pokorny
2f8703620e litest: add nexus4 style touch screen without orientation
This device provides a circular touch point size and and hence lacks
orientation. It will be used to test default value handling.

Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-07 17:49:15 +10:00
Andreas Pokorny
ce86418ad0 litest: add a generic multitouch screen
Adds a device with various touch related axes and respective device features
to litest.

Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-07 17:49:14 +10:00
Andreas Pokorny
e6db46171a litest: add axis_replacement from tablet branch
This change adds strict axis_replacement and litest_touch_move_extended
and litest_touch_down_extended to simulate changes to other axes during
touch down and move events.

Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-07 17:49:12 +10:00
Peter Hutterer
772d69751b Merge branch 'master' into tablet-support 2015-07-06 13:52:57 +10:00
Peter Hutterer
92e415eadd test: add a low-dpi mouse test device
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-07-02 13:03:43 +10:00
Peter Hutterer
ac009c2c20 test: add a waltop tablet test device
Quite similar to wacom tablets but the evdev protocol differs - no serials for
example and only two tools. The device has a wheel, but it's not apparently
part of the stylus like on the wacom tablets. And it has a bunch of keys.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-06-29 15:39:50 +10:00
Peter Hutterer
9610ff849e Merge branch 'master' into tablet-support 2015-06-29 13:56:05 +10:00
Peter Hutterer
3fcdba6ca6 test: replace tap config with helper function
No functional change, other than that we check for status codes now too.
In tests that don't specifically check the interface itself, a short
enable_tap() or disable_tap() is a lot more obvious to parse for the reader.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-06-23 14:24:29 +10:00
Peter Hutterer
0d322c69d0 Merge branch 'master' into tablet-support 2015-06-22 15:20:01 +10:00
Peter Hutterer
56660494ae test: add ALPS DualPoint device
Same as the existing GlidePoint semi-mt device, but this one has a x/y
resolution.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-06-22 08:08:44 +10:00
Peter Hutterer
bc9f16b40e COPYING: Update boilerplate from MIT X11 to MIT Expat license
To quote Bryce Harrington from [1]:
"MIT has released software under several slightly different licenses,
including the old 'X11 License' or 'MIT License'.  Some code under this
license was in fact included in X.org's Xserver in the past.  However,
X.org now prefers the MIT Expat License as the standard (which,
confusingly, is also referred to as the 'MIT License').  See
http://cgit.freedesktop.org/xorg/xserver/tree/COPYING

When Wayland started, it was Kristian Høgsberg's intent to license it
compatibly with X.org.  "I wanted Wayland to be usable (license-wise)
whereever X was usable."  But, the text of the older X11 License was
taken for Wayland, rather than X11's current standard.  This patch
corrects this by swapping in the intended text."

libinput is a fork of weston and thus inherited the original license intent
and the license boilerplate itself.

See this thread on wayland-devel here for a discussion:
http://lists.freedesktop.org/archives/wayland-devel/2015-May/022301.html

[1] http://lists.freedesktop.org/archives/wayland-devel/2015-June/022552.html

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Acked-by: Jonas Ådahl <jadahl@gmail.com>
2015-06-16 14:36:04 +10:00
Peter Hutterer
99aa1f5dc3 Merge branch 'master' into tablet-support 2015-06-04 12:49:18 +10:00
Peter Hutterer
00c75a2667 test: add disable-while-typing tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-05-27 17:38:25 +10:00
Peter Hutterer
087d25a54e Merge branch 'master' into tablet-support 2015-05-22 14:21:21 +10:00
Peter Hutterer
a6be43990c Merge branch 'litest-filter-tests'
The litest-selftest has its own main method and compiles litest.c with special
flags. Use that to ifdef out the litest.c main function, and inline the
litest_run/litest_parse_args functions so gcc doesn't complain about unused
functions.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-22 09:15:15 +10:00
Peter Hutterer
f3d37d9653 test: add filtering to litest framework
Complementary to CK_RUN_SUITE and CK_RUN_CASE, this filters on actual test
function names with a simple fnmatch.

./test/test-touchpad --filter-test="*1fg_tap*"

Most of this patch is renaming litest_add_* to _litest_add_* so we can use the
macros to get at the function names.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-22 08:45:35 +10:00
Peter Hutterer
9dbeb9d0f7 test: move main() into litest
This allows us to filter things based on argv before setting up tests, etc.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-22 08:45:33 +10:00
Peter Hutterer
b84c60737f test: add missing linebreak in debug error message
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-21 17:28:07 +10:00