Commit graph

241 commits

Author SHA1 Message Date
Peter Hutterer
857411f84e Add wheel tilt as axis source
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2017-01-04 15:15:27 +10:00
Peter Hutterer
51e35d72ec tools: reduce some spacing to compress the output a bit
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-03 10:32:51 +10:00
Peter Hutterer
589e320df6 tools: align device notify output better
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-03 10:14:52 +10:00
Peter Hutterer
c92213e24c tools: size in mm is enough, no need for sub-mm precision here
Also changes from W/H to WxH format

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-03 10:14:48 +10:00
Peter Hutterer
16bf0deb23 tools: add allowed range to --set-speed help output
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-03 09:35:40 +10:00
Peter Hutterer
7e5062f632 doc: update the touchpad pointer acceleration svg
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-12-21 10:55:57 +10:00
Peter Hutterer
ec63ecd485 tools: switch the ptraccel-debug printf to use mm/s
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-12-21 10:55:57 +10:00
Peter Hutterer
bdd4264d61 filter: change the filter functions to take raw device coordinates
We used to normalize all deltas to equivalents of a 1000dpi mouse before
passing it into the acceleration functions. This has a bunch of drawbacks, not
least that we already have to un-normalize back into device units for a few
devices already (trackpoints, tablet, low-dpi mice).

Switch the filter code over to use device units, relying on the dpi set
earlier during filter creation to convert to normalized. To make things easy,
the output of the filter code is still normalized data, i.e. data ready to be
handed to the libinput caller.

No effective functional changes. For touchpads, we still send normalized
coordinates (for now, anyway). For the various filter methods, we either drop
the places where we unnormalized before or we normalize where needed.

Two possible changes: for trackpoints and low-dpi mice we had a max dpi factor
of 1.0 before - now we don't anymore. This was only the case if a low-dpi
mouse had more than 1000dpi (never true) or a trackpoint had a const accel
lower than 1.0 (yeah, whatever).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-12-21 10:55:57 +10:00
Peter Hutterer
d1d3ea4d06 tools: add some extra help output about the expected input data
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-12-14 15:19:44 +10:00
Peter Hutterer
86ead3a6ad tools: whitespace change
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-12-14 15:19:41 +10:00
Peter Hutterer
3be2a591a5 tools: local headers use quotes, not pointy brackets
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-12-14 15:19:37 +10:00
Peter Hutterer
ece26cfb70 tools: up the maximum velocity so the output graph shows the leveling off
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-12-14 15:19:25 +10:00
Peter Hutterer
f545cfa923 tools: support --help in the ptraccel-debug tool
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-12-14 15:19:22 +10:00
Peter Hutterer
35dae6bcc0 tools: make sure GCC_FLAGS is used in tools/
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-12-06 11:02:14 +10:00
Peter Hutterer
1e7281fe0a tools: include config.h in libinput-list-devices and ptraccel-debug
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-12-06 11:02:14 +10:00
Peter Hutterer
68513d040d tools: fix comment wording
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-12-06 11:02:13 +10:00
Peter Hutterer
952b562d0c tools: fix signed/unsigned comparison warnings
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-12-06 11:02:13 +10:00
Peter Hutterer
6e1db369ee tools: fix prototype for tools_usage
../tools/shared.h:66:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
void tools_usage();

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-12-06 08:06:27 +10:00
Peter Hutterer
ea7026b7c1 tools: don't define GNU_SOURCE if were including config.h anyway
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
2016-12-01 11:06:52 +10:00
Peter Hutterer
cff370fcd0 tools: print pointer axis source in event-debug
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-11-29 12:14:05 +10:00
Peter Hutterer
364621c001 tools: change --speed to --set-speed for consistency
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-11-29 12:13:23 +10:00
Peter Hutterer
ef2f95dfee Mark some internal log functions as printf-style function
Fixes the respective clang warnings

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2016-10-25 10:00:58 +10:00
Eric Engestrom
9f11610eff tools: change pointer to void
This makes it clear that it's not meant to be dereferenced.

CC: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-09-16 08:27:49 +10:00
Peter Hutterer
b3e9303449 tools: prefix debug output with '-' on device changes
We print the sysname, but it's not always obvious when there's an event from
another device within the stream from another device. Prefix it so it's easier
to spot and search for.

See https://bugzilla.redhat.com/show_bug.cgi?id=1364850#c3 for an example of
how such an event can hide.

We only use last_device for comparing pointer values so we don't need a
reference to the device, it doesn't matter if the device itself goes out of
scope.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-09-08 15:56:15 +10:00
Peter Hutterer
59fac8e902 Add configurable button map to tappings
The previously hardcoded button map for tapping is 1/2/3 to LRM. But the
middle button is a common feature on the desktop (used for paste, most
prominently) and three-finger tapping is almost impossible to do reliably on
some touchpads (e.g. the T440 has a recognition rate of ~1 in 5).

Left and right buttons have a prominent physical position (either softbuttons
or physical buttons) so make the tap order configurable. Those that require
middle buttons reliably can use the [software] buttons for left/right and
2-finger tap for a middle button.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-08-15 09:05:57 +10:00
Peter Hutterer
3c113111fa Remove LIBINPUT_EVENT_TABLET_PAD_MODE event
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-11 11:00:51 +10:00
Peter Hutterer
35a6ebc536 Merge branch 'wip/tablet-pad-modes-v3' 2016-07-04 10:26:03 +10:00
Peter Hutterer
0926f570c4 tablet: make the cursor/lens tool behave like a 1000dpi mouse
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-28 11:28:49 +10:00
Peter Hutterer
97cec18d27 tools: reduce tilt scale to 1/30 of the input value
The x/y tilt angle comes in as degrees, so our scale could be as large as 90x
the original size. Scale to something more sensible.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-06-27 14:52:26 +10:00
Peter Hutterer
6583f4bb53 pad: Add a new API for modes and mode groups
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-22 11:57:07 +10:00
Peter Hutterer
b2772abb46 tools: print button/ring/strip info for pads
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-06-02 12:42:19 +10:00
Peter Hutterer
4f8088066c tools: show tablet-pad capabilities in libinput-list-devices
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-06-02 12:40:22 +10:00
Peter Hutterer
34eff6564d tools: add missing space after listing touch/tablet capabilities
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-06-02 12:40:19 +10:00
Peter Hutterer
e3e8d83457 tools: print the rotation angle in libinput-list-devices
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-30 15:36:46 +10:00
Peter Hutterer
f929aff6c6 tools: add missing space in libinput-list-devices output
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-30 15:36:46 +10:00
Peter Hutterer
7b73269d74 tools: print the pad capabilities
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-26 08:45:29 +10:00
Peter Hutterer
7da1e5fe9c tools: draw some grids for positioning testing in the event-gui
Having a grid makes it easier to detect pointer jumps

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-04-19 15:19:34 +10:00
Peter Hutterer
b2a3706948 Add the LIBINPUT_DEVICE_CAP_TABLET_PAD capability and matching interface
This interface handles the buttons on the physical tablet itself, including
the touch ring and the strip.

A notable difference to other libinput interfaces here is that we do not use
linux/input.h event codes for buttons. Instead, the buttons are merely
numbered sequentially, starting at button 1. This means:
* the API is different, instead of get_button() we have get_button_number() to
  drive the point home
* there is no seat button count. pads are inherently different devices and
  compositors should treat them as such. The seat button count makes sense
  when you want to know how many devices have BTN_LEFT down, but it makes no
  sense for buttons where all the semantics are handled by the compositor
  anyway.

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-04-18 09:12:02 +10:00
Peter Hutterer
817328e171 tools: update the doc publish tool to take a subdir
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-04-12 07:56:52 +10:00
Peter Hutterer
ecd6a0803e tools: print the button name for tablet button events
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-04-08 11:11:15 +10:00
Peter Hutterer
cbf775ba3d tools: fix output to say TABLET_TOOL instead of just tablet
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-05 15:34:25 +10:00
Peter Hutterer
7381ea7a5c tools: split drawing commands into helper functions
Makes the draw() call a bit easier to read

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-01-29 16:06:29 +10:00
Peter Hutterer
9d7f97390d tools: draw the pointer sprite last
Don't hide it behind other things

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-01-28 16:31:22 +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
7899a6cf8d tools: add support for tablet relative events to the event-gui
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Jason Gerecke <jason.gerecke@wacom.com>
2016-01-22 16:16:55 +10:00
Peter Hutterer
91a568d1a1 Merge branch 'master' into tablet-support 2016-01-19 12:02:51 +10:00
Peter Hutterer
b1d6c5aa54 tools: share the axis and tip code where appropriate
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Jason Gerecke <jason.gerecke@wacom.com>
2016-01-15 10:07:05 +10:00
Peter Hutterer
3e6579998a tools: get pressure/distance/tilt from a tip event too
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Jason Gerecke <jason.gerecke@wacom.com>
2016-01-15 10:07:05 +10:00
Peter Hutterer
fec99a28e3 tools: print the button name too, not just the code
new output:
event4 	POINTER_BUTTON    +0.84s	BTN_RIGHT (273) released, seat count: 0

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-01-11 10:11:54 +10:00