Derek Foreman [Thu, 30 Apr 2015 16:43:28 +0000 (11:43 -0500)]
Set O_CLOEXEC when opening devices
We'd rather keep these out of the hands of children.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 30 Apr 2015 02:41:50 +0000 (12:41 +1000)]
tools: ship the event-debug tool as an installed libinput-debug-events tool
Rebuild the same binary but without the special LDFLAG. The event-debug tool
is left as-is to allow for easy debugging with gdb, the new tool is now
libtool-enabled and can't be run directly in gdb without installing it first.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Wed, 29 Apr 2015 04:53:27 +0000 (14:53 +1000)]
test: add a note to the touch double-down event
libevdev filters the ABS_MT_TRACKING_ID event for a double-touch down like
this so we never see this in libinput. We see an error message from libevdev
but otherwise this test is a false negative.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 30 Apr 2015 01:24:48 +0000 (11:24 +1000)]
timer: drain data on the timerfd when it triggers
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Thu, 30 Apr 2015 04:02:30 +0000 (14:02 +1000)]
tools: fix broken build if builddir != srcdir
Introduced in
6b6f8151a41147eb44d08f33de143b43eb004563, libinput-version.h is
in the builddir.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Thu, 30 Apr 2015 05:34:01 +0000 (15:34 +1000)]
evdev: indentation fix
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 30 Apr 2015 02:36:28 +0000 (12:36 +1000)]
tools: fix typo in man page
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 28 Apr 2015 21:53:56 +0000 (07:53 +1000)]
tools: print version number in libinput-list-devices
Makes debugging a bit easier when you can just ask users to do that instead of
digging around in whatever packaging system they have.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
Peter Hutterer [Tue, 28 Apr 2015 06:45:35 +0000 (16:45 +1000)]
evdev: enable button scrolling by default on mice without wheels
If we have a middle button but no wheels, enable on-button scrolling for the
middle button by default. This applies e.g. to the Logitech trackball added as
new test device here.
This makes the separate check for POINTINGSTICK obsolete but I'd rather leave
this in to be more explicit about it.
https://bugs.freedesktop.org/show_bug.cgi?id=90208
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 28 Apr 2015 06:40:29 +0000 (16:40 +1000)]
test: expand the middle button emulation tests
Instead of excluding the pointing stick devices, disable middle button
scrolling on those and run them anyway.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 28 Apr 2015 06:43:01 +0000 (16:43 +1000)]
test: change the suite name for two of the pointer button tests
No need for a separate test suite group here.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 28 Apr 2015 01:53:11 +0000 (11:53 +1000)]
test: fix touch up for multitap-n-drag test
Released the wrong touch point, causing warnings:
libevdev error in sanitize_event: BUG: Device "litest SynPS/2 Synaptics
TouchPad" received a double tracking ID 6 in slot 0.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 28 Apr 2015 00:43:55 +0000 (10:43 +1000)]
doc: expand scrolling documentation
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 24 Apr 2015 05:27:34 +0000 (15:27 +1000)]
test: upgrade to the Microsoft Surface Type Cover
Almost identical to the one we already had but this one also has ABS_X/Y to
mess things up. Update the existing one, no need to add a separate device here.
The fake MT touch test needs to be updated now though. A fake MT device may be
an absolute device too, so if we use the touch_down() handlers we may generate
abs pointer events. That's valid, we only check for no touch events here.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
Peter Hutterer [Fri, 24 Apr 2015 04:59:18 +0000 (14:59 +1000)]
evdev: init pointer accel filters when we have rel x/y axes
Some devices provide abs x/y and rel x/y. We can't know which event the device
will send. The Microsoft Surface Type Cover sends relative events, which
then crashes libinput when we don't have an accel filter set up.
So instead of checking that the device doesn't have ABS_X/Y, check for the
device to have REL_X/Y instead.
https://bugzilla.redhat.com/show_bug.cgi?id=1206869
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
Peter Hutterer [Fri, 24 Apr 2015 05:01:55 +0000 (15:01 +1000)]
evdev: reject devices with only REL_X but no REL_Y (or vice versa)
Not sure if any exists, if they do let's see if a user files a bug report
first so we know what to do with those (they're most likely buttonsets).
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
Peter Hutterer [Fri, 24 Apr 2015 05:07:58 +0000 (15:07 +1000)]
test: add the MS Surface Type Cover to the list of devices
Added in
d2842893a828407e3c4d2459a382f8c7179b2f51 but never added to the list
of devices so none of the tests ran against it.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
Peter Hutterer [Fri, 24 Apr 2015 05:18:17 +0000 (15:18 +1000)]
test: fix features for the MS Surface Cover
LITEST_KEYBOARD is the type, LITEST_KEYS is the feature.
And this device has buttons, so mark it as such.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
Peter Hutterer [Fri, 24 Apr 2015 05:12:09 +0000 (15:12 +1000)]
test: drop REP_DELAY from the ms surface cover event codes
litest doesn't know how to set this up and we don't need it anyway.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
Peter Hutterer [Fri, 24 Apr 2015 05:24:11 +0000 (15:24 +1000)]
test: check for event as not null before dereferencing it
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
Peter Hutterer [Sun, 26 Apr 2015 22:56:50 +0000 (08:56 +1000)]
test: fix a memory leak in the touch test
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
Peter Hutterer [Mon, 27 Apr 2015 01:00:24 +0000 (11:00 +1000)]
test: add semi-mt 2fg scroll test
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Hans de Goede [Fri, 24 Apr 2015 14:49:36 +0000 (16:49 +0200)]
touchpad: Only use slot 0 deltas for 2fg scrolling on semi-mt touchpads
Some semi-mt model touchpads have a better accuracy for slot 0 then for
slot 1 (they only have 2), so on semi-mt models only use the movement of
the touch in slot 0 for 2fg scrolling, rather then the average movement of
the 2 touches.
This fixes 2fg scrolling being choppy / jumpy in some cases.
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=89683
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Also needed: change the touchpad scroll source test to use more separate
events. The current litest semi-mt touch implementation only moves the first
touch on every second move. With 5 movements this isn't enough to fill the
motion history and generate events, so double it to 10 so we're guaranteed to
get scroll events.
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Benjamin Tissoires [Thu, 23 Apr 2015 18:32:40 +0000 (14:32 -0400)]
evdev: use a different filter for low resolution touchpad on the Lenovo X230
Those touchpads presents an actual lower resolution that what is
advertised.
We see some jumps from the cursor due to the big steps in X and Y
when we are receiving data.
For instance, we receive:
E: 13.471932 0003 0000 16366 # EV_ABS / ABS_X 16366
E: 13.471932 0003 0001 9591 # EV_ABS / ABS_Y 9591
E: 13.471932 0000 0000 0000 # ------------ SYN_REPORT (0) ----------
E: 13.479924 0003 0000 16316 # EV_ABS / ABS_X 16316
E: 13.479924 0003 0001 9491 # EV_ABS / ABS_Y 9491
E: 13.479924 0000 0000 0000 # ------------ SYN_REPORT (0) ----------
E: 13.487939 0003 0000 16271 # EV_ABS / ABS_X 16271
E: 13.487939 0003 0001 9403 # EV_ABS / ABS_Y 9403
E: 13.487939 0000 0000 0000 # ------------ SYN_REPORT (0) ----------
-> jumps of ~50 in X in each report, and ~100 for Y.
Apply a factor to minimize those jumps at low speed, and try
keeping the same feeling as regular touchpads at high speed.
It still feels slower but it is usable at least
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Derek Foreman [Fri, 24 Apr 2015 22:23:13 +0000 (17:23 -0500)]
test: add LITEST_KEYS to roccat mouse features
The mouse can generate key events, so it should be carry that feature bit.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Derek Foreman [Fri, 24 Apr 2015 22:21:18 +0000 (17:21 -0500)]
test: Add negative test for libinput_device_keyboard_has_key()
Ensure we get a -1 return for non-keyboard devices.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 24 Apr 2015 02:25:50 +0000 (12:25 +1000)]
touchpad: allow BTN_LEFT in clickfinger mode without touches
On the Logitech T650 it's quite easy to trigger a click without touching the
surface. For software buttons we discard those clicks because we can't tell
where the finger is to decide on left vs right click.
It takes effort to trigger a click with two fingers without triggering a touch
though, so in clickfinger mode post a click without touches as single-finger
click.
https://bugs.freedesktop.org/show_bug.cgi?id=90150
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Fri, 24 Apr 2015 02:36:43 +0000 (12:36 +1000)]
touchpad: minor code cleanup
No functional changes, just reducing to one instance of the call with a
variable parameter.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 24 Apr 2015 02:23:45 +0000 (12:23 +1000)]
touchpad: don't re-use button variable
Split into button and area, the latter of which is the bitmask of which area
we're in. No functional changes.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 24 Apr 2015 02:02:28 +0000 (12:02 +1000)]
touchpad: indentation and other whitespace fixes
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 20 Apr 2015 18:29:44 +0000 (14:29 -0400)]
evdev: add support for LIBINPUT_MODEL_* udev tags
Some devices need specific configuration or different defaults.
Push that into udev rules and a hwdb file, that's where detection is the
easiest. The LIBINPUT_MODEL_ prefix is used to determine some type of device
model. Note that this property is a private API and subject to change at
any time without notice.
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>
Hans de Goede [Wed, 22 Apr 2015 08:32:38 +0000 (10:32 +0200)]
test-touchpad: Adjust touchpad_edge_scroll_no_2fg test for gesture support
Unlike all the other 2fg scroll tests the touchpad_edge_scroll_no_2fg test
puts the 2 fingers down quite far apart, this makes the pinch vs scroll
gesture detection code in the gestures branch detect a pinch causing the
test to fail.
This commit brings the finger placement in line with the other 2fg scroll
tests fixing this.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 22 Apr 2015 04:36:25 +0000 (14:36 +1000)]
Add libinput_device_keyboard_has_key()
Similar to libinput_device_pointer_has_button(), this function returns whether
a given device has a specific keycode.
This enables a caller to determine if the device is really a keyboard (check
for KEY_A-KEY_Z) or just a media key device (check for KEY_PLAY or somesuch),
depending on the context required.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Hans de Goede [Wed, 1 Apr 2015 09:03:19 +0000 (11:03 +0200)]
evdev: Add support for POINTINGSTICK_CONST_ACCEL udev property
There is quite a wide spread in the delta events generated by trackpoints,
some generate deltas of 1-2 under normal use, while others generate deltas
from 1-20.
It is desirable to normalize trackpoint deltas just like we are normalizing
mouse deltas to 1000 dpi, so as to give different model laptops aprox.
the same trackpoint cursor speed ootb.
Recent versions of udev + hwdb set a POINTINGSTICK_CONST_ACCEL udev property
which can be used to adjust trackpoints which are too slow / too fast
ootb, this commit implements support for that property.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 22 Apr 2015 05:31:21 +0000 (15:31 +1000)]
tools: use doubles to back the scroll bars
Slow scrolling otherwise won't move them because we keep truncating the
subpixels.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 21 Apr 2015 23:19:13 +0000 (09:19 +1000)]
configure.ac: libinput 0.14.1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 21 Apr 2015 23:18:34 +0000 (09:18 +1000)]
tools: distribute the new man page
Fixes distcheck
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 21 Apr 2015 22:20:56 +0000 (08:20 +1000)]
configure.ac: libinput 0.14.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 21 Apr 2015 22:24:27 +0000 (08:24 +1000)]
Update to v4.0 kernel header
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 21 Apr 2015 22:20:34 +0000 (08:20 +1000)]
Sort the middle button symbols additions correctly
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 21 Apr 2015 22:16:42 +0000 (08:16 +1000)]
doc: add a note that sometimes there's more than one ID_INPUT_* set
Just setting one of them on a device doesn't guarantee that libinput takes
that as device type.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 21 Apr 2015 08:24:39 +0000 (18:24 +1000)]
tools: add --set-scroll-button as option
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 21 Apr 2015 08:01:26 +0000 (18:01 +1000)]
test: mix mixing of middle buttons state vs config status enum types
Coverity complaint: mixed_enums: Mixing enum types enum
libinput_config_middle_emulation_state and enum libinput_config_status
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 21 Apr 2015 02:07:55 +0000 (12:07 +1000)]
touchpad: don't post 2fg scrolling when edge scrolling is enabled
https://bugs.freedesktop.org/show_bug.cgi?id=90070
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 21 Apr 2015 04:55:49 +0000 (14:55 +1000)]
test: adjust the movement size for edge scroll timeout testing
The goal of this test is to make sure that the deltas are less than 5, which
is the scroll trigger for movement-based edge scrolling. The litest suite
takes percentages of the device, so use a scale factor to change how far we
move on the tablet. The wacom tablet is 141mm, the movement must be smaller to
provide small-enough deltas.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 21 Apr 2015 03:53:55 +0000 (13:53 +1000)]
test: extend edge scrolling tests to all non-clickpads
The single finger requirement dates back to when we couldn't configure the
scroll method. Now we can, so let's run the tests on as many suitable devices
as possible.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 21 Apr 2015 02:05:36 +0000 (12:05 +1000)]
test: enable edge scrolling in all edge scroll tests
Just to make sure it is enabled (it should be anyway).
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 21 Apr 2015 01:57:23 +0000 (11:57 +1000)]
tools: add --set-scroll-method commandline flag
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Fri, 17 Apr 2015 05:59:36 +0000 (15:59 +1000)]
evdev: accept but disable ABS_MISC and above for min/max == 0
This is sort-of legitimate, so simply disable the axes and continue.
Any real axis we require to have a real range.
https://bugs.freedesktop.org/show_bug.cgi?id=90090
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Thu, 16 Apr 2015 00:19:11 +0000 (10:19 +1000)]
touchpad: introduce MULTITAP for multi-tap-and-drag
Once we have a doubletap, enter a loop in the state machine where we can tap
multiple times and either get a multi-click or a multi-click drag-and-drop.
The sequence down/up down/up down/up produces a triple-click. The sequence
down/up down/up down/up down produces a triple-click with a button down for
dragging. Yes, that glorious octuple-tap-and-drag, it is now possible. World
domination has been achieved, thank you for playing.
We don't know when we finish tapping now, so add a timeout to send the last
click event once the finger has been released for the last time. This
guarantees that the timestamp of the last button down is later than the
last release. This avoids the bug fixed in synaptics commit
xf86-input-synaptics-1.8.0-21-g37d34f0 (some application don't handle
doubletap correctly without the timestamps).
This works for double-tap immediately, for multi-tap we need to remember the
timestamp of the first press event and use it for the release event so that
there's a forced gap between the release and the second press.
https://bugs.freedesktop.org/show_bug.cgi?id=89511
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Thu, 16 Apr 2015 00:42:16 +0000 (10:42 +1000)]
test: add litest_is_button_event
Makes it easier from a caller to check for common things without all the other
boilerplate code.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 14 Apr 2015 04:43:53 +0000 (14:43 +1000)]
test: middle button emulation tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 14 Apr 2015 04:40:49 +0000 (14:40 +1000)]
touchpad: enable middle button emulation on some touchpads
If the touchpad has left/right physical buttons but no middle button, force
middle button emulation - without a config option, it's always on.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 14 Apr 2015 04:41:39 +0000 (14:41 +1000)]
evdev: enable middle button configuration on some devices
Devices that have left and right buttons but no middle button get middle
button emulation (without config). Devices that have a middle button too get
a config option but default to off. Most mice have LMR set as buttons,
regardless whether they have a middle button.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Mon, 13 Apr 2015 06:38:44 +0000 (16:38 +1000)]
evdev: add support for middle button emulation
This is just the required framework, it's not hooked up to anything just yet.
Hooking it up comes as separate commit to better detail why/when a device
supports emulation.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 14 Apr 2015 02:08:33 +0000 (12:08 +1000)]
Add middle mouse button emulation config options
Adds the following quartett of functions to enable/disable middle mouse button
emulation on a device:
libinput_device_config_middle_emulation_is_available()
libinput_device_config_middle_emulation_set_enabled()
libinput_device_config_middle_emulation_get_enabled()
libinput_device_config_middle_emulation_get_default_enabled()
This patch only adds the config framework, it is not hooked up to anything
yet.
Note: like other features this is merely the config option, some devices will
provide middle button emulation without exposing it as configuration. i.e. the
return value of libinput_device_config_middle_emulation_is_available() only
tells you whether you can _configure_ middle button emulation.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Mon, 13 Apr 2015 04:47:26 +0000 (14:47 +1000)]
evdev: add evdev_pointer_notify_physical_button
No functional changes at this point, this merely splits up any physical
buttons (i.e. that represent buttons that exist on that device) vs. other
buttons that are emulated in some way or another.
This is in preparation for the addition of middle button emulation.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 14 Apr 2015 05:18:19 +0000 (15:18 +1000)]
toucphad: fix a comment for the new min touchpad palm detection size
Missing from
26062e84693341d5a6b7b33af91a50a9cd37dfe2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 16 Apr 2015 06:13:01 +0000 (16:13 +1000)]
touchpad: reduce palm detection threshold to 70mm
https://bugzilla.redhat.com/show_bug.cgi?id=1209753 lists a touchpad 76mm wide
that suffers from palm touches
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Wed, 15 Apr 2015 05:21:08 +0000 (15:21 +1000)]
touchpad: don't allow taps in the top half of the palm exclusion zone.
Touches in the exclusion zone are ignored for palm detection and don't move
the cursor. Tapping however triggers before we know whether something is a
palm or not, so we get erroneous button clickst.
If a tap happens in the top half of the touchpad, within the palm exclusion
zones, ignore it for tap purposes. To avoid further complicating the state
machine simply pretend there was a movement > threshold on that finger. This
advances the tap state machine properly that no button events are sent for
this finger.
https://bugs.freedesktop.org/show_bug.cgi?id=89625
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 14 Apr 2015 07:04:45 +0000 (17:04 +1000)]
touchpad: only pair internal trackpoint devices with internal touchpads
Internal touchpads with trackpoints are either BUS_I8042 or BUS_I2C, but not
BUS_USB. Lenovo sells external keyboards with a trackpoint built-in, make sure
we don't pair that trackpoint with the internal touchpad.
And likewise, the internal trackpoint should not be paired with e.g. a wacom
touch device.
Lenovo had one external device that has a trackpoint and a touchpad on an
external keyboard. That device won't be covered with this patch, if we have a
user we can re-consider.
https://bugs.freedesktop.org/show_bug.cgi?id=89935
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Wed, 15 Apr 2015 01:44:54 +0000 (11:44 +1000)]
tools: add a tool to list local devices and the default configurations
xinput or an equivalent isn't available under wayland, but the majority of
use-cases of "why doesn't my device work" or "why does feature X not work"
should be covered by simply listing the local devices and their config
options.
Example output:
Device: SynPS/2 Synaptics TouchPad
Kernel: /dev/input/event4
Group: 9
Seat: seat0, default
Size: 97.33x62.40mm
Capabilities: pointer
Tap-to-click: disabled
Left-handed: disabled
Nat.scrolling: disabled
Calibration: n/a
Scroll methods: *two-finger
Click methods: *button-areas clickfinger
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Wed, 15 Apr 2015 05:33:41 +0000 (15:33 +1000)]
touchpad: extend two debug messages
Makes it quicker to know where it's coming from.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 14 Apr 2015 02:26:01 +0000 (12:26 +1000)]
evdev: merge two conditions into one with a sub condition
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 15 Apr 2015 00:09:34 +0000 (10:09 +1000)]
evdev: add a event-debugging log statement (ifdef'd out)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 15 Apr 2015 00:21:47 +0000 (10:21 +1000)]
Return INVALID before UNSUPPORTED for click methods
All other config options already follow this behavior.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 13 Apr 2015 00:23:47 +0000 (10:23 +1000)]
test: add a scrollwheel-only device
This currently requires a specific udev rule to tag the device, once the
matching bits are upstream we can drop this.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Mon, 13 Apr 2015 00:23:46 +0000 (10:23 +1000)]
Don't post a events for a missing capability
Log a bug instead.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Mon, 13 Apr 2015 00:23:45 +0000 (10:23 +1000)]
evdev: any scroll device must have CAP_POINTER
Follow-up to
e2f61b8fb74a06b86abd02caa4cdfde5edc53a32.
Scroll events are sent through the pointer interface, so we must set the
capability. Otherwise a caller may not have the required bits set up and is a
bit surprised by events coming out of an interface the device doesn't actually
have (xf86-input-libinput crashes when this happens).
Reported-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Fri, 10 Apr 2015 05:37:15 +0000 (15:37 +1000)]
tools: add a tool for printing pointer acceleration parameters
Prints the various pointer accel behaviors into a format understood by
gnuplot, which then provides prettiness.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Hans de Goede [Thu, 9 Apr 2015 14:42:00 +0000 (16:42 +0200)]
filter: Make acceleration range wider
The main purpose of this patch is to allow the user to actually slow
down pointer movement using libinput_device_config_accel_set_speed, this
is achieved by changing the max-accel setting from "2.0 - speed" to
"2.0 - speed * 1.5", resulting in a max-accel of 0.5 when the user configures
speed at -1.0, the other accel profile parameters are adjusted by the same
factor to keep the curve the same.
This means that the user can get the exact same behavior as before by
multiplying the old setting by 0.6667 (2/3), this also means that this
change not only allows the user to select a slower speed, but to keep
things balanced the same as before, also a higher speed.
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>
Peter Hutterer [Fri, 10 Apr 2015 05:45:59 +0000 (15:45 +1000)]
tools: add commandline flag to control the pointer accel speed
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 10 Apr 2015 05:45:35 +0000 (15:45 +1000)]
tools: apply the config options for the event-gui helper too
This changes the current behavior of tapping enabled-by-default in the GUI
helper.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 9 Apr 2015 05:27:34 +0000 (15:27 +1000)]
touchpad: rename real_touches to num_slots
Less ambiguous since real_touches can be interpreted to "current number of
real touches as opposed to fake touches". Which it isn't, this variable holds
the number of slots.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Thu, 9 Apr 2015 05:27:33 +0000 (15:27 +1000)]
touchpad: a touch in TOUCH_NONE doesn't need to be ended
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Thu, 9 Apr 2015 04:23:16 +0000 (14:23 +1000)]
touchpad: detect fake finger overflow after BTN_TOOL_QUINTTAB
Up to QUINTTAP, we count fake fingers through the BTN_TOOL_*TAP kernel defines.
Once we exceed QUINTTAP, the nfake_finger count returns to 0 and
tp_unhover_touches terminates all touch sequences. The most visible effect of
this was stopped in 591a41f but the problem remained.
Since we're not using 5 fingers for anything, use that to set the
overflow flag. The kernel gives us either a BTN_TOUCH 0 (all
released) or a lower BTN_TOOL_*TAP to unset the flag when we go below 5
fingers again.
And if we overflow, we can skip the unhovering of touch points since we a)
have a decent touchpad that gives us real touchpoints and b) hovering isn't
supported for 5 touches anyway.
https://bugs.freedesktop.org/show_bug.cgi?id=89800
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Wed, 8 Apr 2015 21:51:51 +0000 (07:51 +1000)]
evdev: reject devices with only one of x/y resolution
This is a kernel bug, reject such devices outright. This saves us from a bunch
of extra double checks to make sure that the resolutions are always set up.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Wed, 8 Apr 2015 07:00:50 +0000 (17:00 +1000)]
touchpad: delay fake finger processing until the EV_SYN
A switch from BTN_TOOL_FINGER to BTN_TOOL_DOUBLETAP sets the former to 0, then
the latter to 1, within the same frame. In the previous code we'd end the
first touchpoint, then start two new ones immediately after when the DOUBLETAP
comes in. This causes bug notices in the edge scrolling code and finger
miscounts in the tapping code (since neither processes the change, there is no
SYN_REPORT between the two).
Only update the state bits when we get the events, handle the fake touch
sequence start/end on SYN_REPORT instead.
https://bugs.freedesktop.org/show_bug.cgi?id=89949
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Wed, 8 Apr 2015 04:54:39 +0000 (14:54 +1000)]
touchpad: add state debugging to the edge scroll state machine
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 8 Apr 2015 04:52:44 +0000 (14:52 +1000)]
touchpad: remove trailing semicolon from macro
Avoids empty statements
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 8 Apr 2015 06:05:15 +0000 (16:05 +1000)]
evdev: fix inverted mouse normalization
Regression introduced in
9f8edc5fd880e0a9c482b36e6b4120ccc056ee0b where it
changed from delta / (dpi/default) to delta * dpi/default, causing the inverse
effect of what the dpi setting is supposed to achieve.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Wed, 8 Apr 2015 03:54:57 +0000 (13:54 +1000)]
touchpad: count the tapping fingers separately from the main touchpad code
tp->nfingers_down gives us the current state of the touchpad but in the case
of the tapping state we need the touchpoints separately. If all touchpoints
end in the same SYN_REPORT frame, tp->nfingers_down is 0 when we handle the
touch releases. This changes the tap state to IDLE on the first release and
then logs a bug when the remaining touches are released while the touchpad is
in IDLE.
Avoid this by counting the fingers separately for the tap state, this way we
can count up/down with the down/up events as we process them for the tapping
state machine.
This also adds tests for 4 and 5-finger tapping which is how the bug was
discovered in the first place.
https://bugs.freedesktop.org/show_bug.cgi?id=89800
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 7 Apr 2015 23:54:33 +0000 (09:54 +1000)]
test: add the Razer BlackWidow keyboard device
This device has a couple of axes (fake MT) and a wheel. The device itself
exports 4 nodes, this device is the second node, the most problematic one.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 7 Apr 2015 23:54:32 +0000 (09:54 +1000)]
evdev: if a keyboard has a scroll wheel, allow natural scrolling
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 7 Apr 2015 23:54:31 +0000 (09:54 +1000)]
test: adjust scroll wheel test for HWHEEL-only devices
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 7 Apr 2015 23:54:30 +0000 (09:54 +1000)]
evdev: fix handling of fake MT devices without ABS_X/Y
The previous code didn't handle fake MT devices without ABS_X/Y axes (like the
Razer BlackWidow keyboard). Those devices usually start at ABS_MISC and go up
to ABS_MAX, thus triggering the Android check.
Split the condition up: if the device is not a fake MT device we check for the
Android missing axes first and add them. Then we proceed, but now we know that
the ABS_X axis must exist on any valid device.
https://bugs.freedesktop.org/show_bug.cgi?id=89783
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 7 Apr 2015 23:54:29 +0000 (09:54 +1000)]
evdev: fix crash for missing ABS_X/Y
libevdev_set_abs_info() is a noop if the event code isn't enabled on the
device. This leaves ABS_X/Y on NULL, causing a crash later when dereferencing
the absinfo.
https://bugs.freedesktop.org/show_bug.cgi?id=89783
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 7 Apr 2015 22:09:41 +0000 (08:09 +1000)]
include: update to v3.18 header
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Hans de Goede [Wed, 25 Mar 2015 14:05:19 +0000 (15:05 +0100)]
Change vector_get_direction input to a normalized_coords struct
Change vector_get_direction input to a normalized_coords type rather than
passing in a separate x,y pair, and rename it normalized_get_direction to
match. Since it now depends on the normalized_coords type which gets declared
in libinput-private.h also move it to libinput-private.h .
Note this commit also contains a functional change wrt the get_direction
usuage in the palm detection. The palm-detection code was calling get_direction
on non normalized coordinates, this commits changes the code to normalize
the coordinates first. This is the right thing to do as calling get_direction
on non normalized coordinates may result in a wrong direction getting returned
when the x and y resolution of the touchpad are not identical.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Hans de Goede [Wed, 25 Mar 2015 10:01:04 +0000 (11:01 +0100)]
Rename delta_coords to device_float_coords
What we really need is not a specific delta type, but a type which can hold
non discrete device coordinates, this is e.g. also needed for the center
coordinates of gestures. So rename delta_coords to device_float_coords to
properly reflect what we really need.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Hans de Goede [Tue, 24 Mar 2015 15:43:24 +0000 (16:43 +0100)]
Change tp_filter_motion to normalized_coords
Change tp_filter_motion to use normalized_coords, rather then having it take
separate x and y values.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Hans de Goede [Tue, 24 Mar 2015 15:33:29 +0000 (16:33 +0100)]
Add a normalized_is_zero helper function
Add a normalized_is_zero helper function, and use it where applicable.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Hans de Goede [Tue, 24 Mar 2015 12:14:19 +0000 (13:14 +0100)]
Add a normalized_length helper function and use this where applicable
Add a normalized_length helper function and use this where applicable,
just a minor cleanup.
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>
Hans de Goede [Tue, 24 Mar 2015 12:14:18 +0000 (13:14 +0100)]
Add a delta_coords type and use it were applicable
tp_normalize_coords is one of the last functions taking separate x, y
values rather a coordinate pair, this commit cleans this up.
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>
Hans de Goede [Tue, 24 Mar 2015 12:14:17 +0000 (13:14 +0100)]
Fix scroll-threshold check for edge-scrolling to use normalized coordinates
The DEFAULT_SCROLL_THRESHOLD value is a TP_MM_TO_DPI_NORMALIZED value and as
such should be compared to a normalized value. But since commit
8101e43774
("touchpad: switch delta handling to typesafe coordinates"), the
initial_dx / initial_dy values initial_delta points to are no longer in
normalized coordinates, as the result of tp_normalize_delta is now stored
into the normalized value.
This commit changes the check to use the delta pointer which does point to
the normalized x/y values. While at it also use the zero variable to
set normalized to zero rather then manually setting x and y to 0.
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>
Peter Hutterer [Tue, 24 Mar 2015 05:49:41 +0000 (15:49 +1000)]
configure.ac: libinput 0.13.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 23 Mar 2015 02:08:14 +0000 (12:08 +1000)]
evdev: reject devices with a min == max axis range
Except for a few axes where this may be correct, a min == max axis range
indicates a broken kernel driver. To avoid potential divisions by zero when
scaling this axis later, reject such a device outright.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Fri, 20 Mar 2015 01:09:05 +0000 (11:09 +1000)]
Revert "touchpad: parse the TOUCHPAD_RESOLUTION property"
This reverts commit
0e64837f30c310da878f28961a6db7c4bcd4f282.
Rather than a customized touchpad property, let udev handle this and set the
absinfo struct during the normal setup procedures. No need for libinput to
have a custom workaround here.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Tue, 17 Mar 2015 23:44:09 +0000 (09:44 +1000)]
tools: don't use deprecated gdk_cursor_new()
Replaced by gdk_cursor_new_from_display() which means we need to tickle the
event until it spits out a GdkDisplay.
Deprecated in gdk 3.16
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Peter Hutterer [Thu, 19 Mar 2015 01:43:49 +0000 (11:43 +1000)]
test: add accel test for direction change
Make sure that if we go in one direction, then change flip over to the other
direction we actually stop going into that direction, and the delta is lower
than whatever the previous delta was (i.e. acceleration resets).
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>