Commit graph

536 commits

Author SHA1 Message Date
Stephen Chandler Paul
49cdfd2a06 test: Add motion event test for tablets
Based off the patch originally written by Carlos Garnacho

Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-06-17 17:17:14 -04:00
Stephen Chandler Paul
a152ece99f test: Add proximity tests
This tests to make sure proximity events actually work, that they don't output
cooirdinate events after they occur, and that they make sure to release all of
the buttons and clear the values of all the axes

Based off the patch originally written by Carlos Garnacho

Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-06-17 17:17:14 -04:00
Carlos Garnacho
0716580fc2 test: Add Wacom ISDv4 E6 Pen device definition
Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-06-17 17:17:14 -04:00
Carlos Garnacho
c5736b7a9b test: Add Wacom Intuos5 touch M Pen device definition
Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-06-17 17:17:14 -04:00
Carlos Garnacho
20343ab41c test: Add Wacom Cintiq 12WX device definition
Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-06-17 17:17:14 -04:00
Carlos Garnacho
f43a9b2c76 test: Add Wacom Bamboo 16FG 4x5 Pen device definition
Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-06-17 17:17:14 -04:00
Stephen Chandler Paul
9d96286a44 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>
2014-06-17 17:17:14 -04:00
Carlos Garnacho
204d1d7514 test: Add infrastructure for testing tablet events.
no vfuncs are used, only input_event arrays.

Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-06-17 17:17:14 -04:00
Stephen Chandler Paul
6d0fceb225 tools: Handle pressure, tilt, and distance in event-debug
Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-06-17 17:17:14 -04:00
Stephen Chandler Paul
4e4ff21e31 Sanitize distance and pressure axes before reporting their values
This commit changes two things with the way distance and pressure axes are
reported:
1. Distance and pressure are made mutually exclusive. When there is a distance
   event and a pressure event and the tool is in contact with the tablet, only
   the pressure change will be reported. When the tool is not in contact and
   both a distance and pressure change are received, only the distance update
   will be received.
2. Bad distance events are not reported to the caller. There is a certain
   distance a tool can be from the tablet where the tablet recongnizes that a
   tool appeared, but the tool doesn't send any useful information to the
   tablet. When this happens, the distance will update to it's minimum or
   maximum value, and no other axis updates will be sent. Since this can give
   a caller the impression that the tool is within a useful proximity of the
   tablet, we filter out any distance events with a value of maximum or minimum
   when the tool is not within useful proximity of the tablet.

Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-06-17 17:17:14 -04:00
Stephen Chandler Paul
8f572b6fd1 tablet: Report and normalize distance, pressure, and tilt axes
Report the values for the distance, pressure, and tilt axes. Pressure is
normalized to a range of 0 to 1, and tilt is normalized to a range of -1 to 1.

Based off the patch originally written by Carlos Garnacho

Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-06-17 17:17:14 -04:00
Stephen Chandler Paul
b2629dc8a1 tools: handle tablet button events in event-debug
Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-06-17 17:17:14 -04:00
Stephen Chandler Paul
5561e4502d tablet: Handle button-events
Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-06-17 17:17:14 -04:00
Stephen Chandler Paul
e5f7ec9d53 tools: Handle LIBINPUT_EVENT_TABLET_PROXIMITY_OUT in event-debug
Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-06-17 17:17:14 -04:00
Stephen Chandler Paul
5fa892a88e Emit LIBINPUT_EVENT_TABLET_PROXIMITY_OUT when tool leaves proximity
This event is just used to notify the caller when the tool's no longer in
proximity. When an event like this occurs, everything from evdev up until the
next EV_SYN event is discarded along with any events that occured since the last
EV_SYN event. This also silences any tool update events where the tool type is
changed to LIBINPUT_TOOL_NONE, so we don't end up filling the tool list with a
bunch of tools that aren't actually tools.

Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-06-17 17:17:13 -04:00
Stephen Chandler Paul
535c2cab2c tools: handle LIBINPUT_TABLET_EVENT_TOOL_UPDATE in event-debug
Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-06-17 17:17:13 -04:00
Stephen Chandler Paul
e5212e2080 Emit LIBINPUT_TABLET_EVENT_TOOL_UPDATE events on tool changes
Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-06-17 17:17:11 -04:00
Stephen Chandler Paul
3a65184287 Add the libinput_tool object
This will be used to represent a tool in use on a drawing tablet.

Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-06-17 17:16:01 -04:00
Stephen Chandler Paul
88421c7583 tools: handle TABLET_EVENT_AXIS in event-debug
Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-06-17 17:16:01 -04:00
Stephen Chandler Paul
9357166114 evdev: Add basic support for tablet devices
These devices set the LIBINPUT_DEVICE_CAP_TABLET flag, and emit a lot more axis
information then mice and touchpads. As such, tablet events are in a whole new
group of events that is separate from everything else.

In this commit, only X and Y axes are reported in libinput.

Based off the patch originally written by Carlos Garnacho

Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-06-17 17:15:58 -04:00
Carlos Garnacho
53affdc9bb Add LIBINPUT_DEVICE_CAP_TABLET libinput_device_capability value
This capability flag would be enabled when events are driven through
a stylus, ie. on a tablet.

Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-06-16 20:31:03 -04:00
Stephen Chandler Paul
812ea542e7 Add bitfield helper functions from libdevdev-util.h and some tests
Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-06-16 20:31:03 -04:00
Peter Hutterer
6fa0c9aa97 tools: fix the publish-doc script
Original script was broken, curse those last-minute changes before pushing

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-06-16 16:44:34 +10:00
Peter Hutterer
2e289b2026 Document the top software button behavior
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-06-13 11:49:45 +10:00
Peter Hutterer
1db5866cee test: fix a path test
Test with the right interface, otherwise checking to make sure we didn't call
open on any device is a bit pointless.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-06-13 11:48:53 +10:00
Peter Hutterer
d1f1563aab path: log two errors as application bugs
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-06-13 11:48:14 +10:00
Peter Hutterer
7f577e8d49 doc: ignore LIBINPUT_ATTRIBUTE_PRINTF in doxygen
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-06-13 11:48:07 +10:00
Peter Hutterer
509d31b810 Add two doxygen cross-references for the logging functions
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-06-13 11:48:04 +10:00
Peter Hutterer
2bf748701d test: add a couple of top software button test
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-06-12 10:29:26 +10:00
Peter Hutterer
d4c29a0af8 test: Add description for the T440 synaptics touchpad
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-06-12 10:29:26 +10:00
Peter Hutterer
6cd7a030c1 test: add clickpad software button tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-06-12 10:29:26 +10:00
Peter Hutterer
466c1acf48 test: add a bunch of test for click behavior on touchpads
Mainly testing the behaviour when clicking during a tap or tap-n-drag. Adds a
new "feature" to the litest system, Apple clickpads don't have software
buttons by default.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-06-12 10:29:26 +10:00
Peter Hutterer
e0ce8a67ea test: add litest_assert_empty_queue helper function
Checks if the queue is empty and prints informatino about any events before
failing.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-06-12 10:29:26 +10:00
Peter Hutterer
fc51daff73 touchpad: always call into the the tap state machine
A button event consumed by the softbutton or clickpad code does not feed into
the tap state machine, leaving it in its current state. The touch generating
that event however may have triggered state changes.

For some tap/click combinations this gives us either double press/release
events or an inconsistent order of events. Those issues include:
* a really short physical click causes a click + tap-click
* a really short physical click on the right software button causes a right
  click + left tap-click
* tap + click causes double button left press events

To avoid these, notify the tap code that a button event has occured and
process that accordingly. Depending on the state this may either continue to
the DEAD state or release the current tap button and then go to the DEAD
state.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-06-12 10:29:26 +10:00
Hans de Goede
4ddd19d6bd Add a log_msg_va function
This is useful for when we use libraries which want us to provide them with
a logging callback.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-06-11 10:31:43 +10:00
Hans de Goede
96445bc243 timer.h: Add #include libinput-util.h
libinput-util.h is needed for the linked list definitions.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-06-11 10:30:12 +10:00
Peter Hutterer
5a0c06b0d1 touchpad: Prefix tap-debugging message
For consistency with the butto state debugging

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-06-11 09:58:55 +10:00
Peter Hutterer
c433017388 touchpad: log the invalid event as bug, not just as info
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-06-11 09:58:55 +10:00
Peter Hutterer
7149cc9392 test: use check's strcmp API instead of strcmp
Prints out the strings on failure - easier for debugging

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-06-11 09:43:52 +10:00
Peter Hutterer
145cdf6c79 test: drop unused includes for libinput-util.h
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-06-11 09:43:52 +10:00
Hans de Goede
04c7987443 evdev-mt-touchpad-tap: Switch over to new timer subsystem
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-06-10 20:55:18 +10:00
Hans de Goede
31ef8bff44 evdev-mt-touchpad-buttons: Switch over to new timer subsystem
Besides being a nice cleanup, this gives us proper per touch timeouts.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-06-10 20:55:18 +10:00
Hans de Goede
f638677051 Add a timer subsystem
Currently we are using DIY timers in the touchpad softbutton and tap handling
code, and at least the softbutton code gets its wrong. It uses one timer-fd
per touchpad to set a timeout per touch, which means that if a timeout is
set for 100ms from now for touch 1, and then 50 ms later touch 2 sets a timeout
for 200 ms from now, then the timeout for touch 1 will come 150 ms too late.

This commits adds a proper timer subsystem so that we've one place to deal
with timer handling, and so that we can only get it wrong (well hopefully
we get it right) in one place.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-06-10 20:55:18 +10:00
Peter Hutterer
7222f839d0 Mark the log function as attribute printf
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-06-10 20:55:10 +10:00
Peter Hutterer
56ae994efa test: add --verbose flag to litests
Sometimes it's handy to see what libinput prints out while running a test.
This breaks test-log if run with --verbose. Checking that the default log
priority hasn't changed obviously doesn't work if we change it on demand.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-06-10 20:55:04 +10:00
Peter Hutterer
2ddc7a93f2 test: drop TEST_CFLAGS
We're using the same flags for everything anyway, drop the custom flags

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-06-10 20:54:57 +10:00
Peter Hutterer
63927631a4 test: silence compiler warning for C++ build test
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for
C/ObjC but not for C++ [enabled by default]

Since gcc also complains about adding -Wno-strict-prototypes we have to handle
the two separately. A side-effect here: now that we promote the GCC_CFLAGS to
AM_CFLAGS, litest.la is built with the correct CFLAGS too.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-06-10 20:54:53 +10:00
Peter Hutterer
e64a0147cd test: fix compiler warnings for missing field initializers
litest-trackpoint.c:38:1: warning: missing initializer for field 'touch_down'
of 'struct litest_device_interface' [-Wmissing-field-initializers]

and similar

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-06-10 20:54:48 +10:00
Peter Hutterer
fd55256768 test: fix compiler warnings for missing prototypes
litest-wacom-touch.c:31:6: warning: no previous prototype for
'litest_wacom_touch_setup' [-Wmissing-prototypes]

and similar

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-06-10 20:54:42 +10:00
Peter Hutterer
51d28f215e test: fix compiler warning for is_debugger_attached
litest.c:207:1: warning: function declaration isn't a prototype
[-Wstrict-prototypes]

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-06-10 20:54:38 +10:00