Commit graph

67 commits

Author SHA1 Message Date
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
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
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
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
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
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
0b124a1a5d tablet: insert "STATE" into proximity/tip states
Makes it even longer, but at least it's consistent with button and key state.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
2016-01-06 11:02:40 +10:00
Peter Hutterer
e5a33086bc tablet: rename axis_get_value into an axis-specific API set
Second part of the big revamp to get rid of libinput_tablet_tool_axis and
replace it with a set of axis-specific APIs.

Note that this commit drops the ability to get the absolute value from a
relative wheel. The previous API always returned 0 for this case, it is not
needed anymore.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Lyude <cpaul@redhat.com>
2015-12-21 07:59:00 +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
2cfd52244a 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
759ef04465 tablet: rename TOOL_TIP to TABLET_TOOL_TIP
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
cc2b45dd50 tablet: rename TOOL_PROXIMITY_ to TABLET_TOOL_PROXIMITY
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-11-18 12:13:53 +10:00
Peter Hutterer
827abfbb56 tablet: rename the tablet axes to "LIBINPUT_TABLET_TOOL_AXIS_..."
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-11-18 12:13:53 +10:00
Peter Hutterer
1318ffadb5 tablet: split out tip handling into a separate event
The tablet tip works like a button in the kernel but is otherwise not really
a button. Split it into an explicit tip up/down event instead.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-11-12 06:52:51 +10:00
Peter Hutterer
9d07f8af40 tools: add tablet support to event-gui
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
2015-11-05 14:37:29 +10:00
Peter Hutterer
a7bd84a7ee Merge branch 'master' into tablet-support 2015-07-24 10:56:05 +10:00
Peter Hutterer
f5abded2e5 tools: handle the initial set of events at event-gui's startup
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-21 15:17:54 +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
Peter Hutterer
bca183ec8e tools: handle pinch event in event-gui
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-07-06 14:09:33 +10:00
Peter Hutterer
f3f2b312ea tools: add swipe support to the event-gui
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-07-06 14:09:33 +10:00
Hans de Goede
98b1e212ac touchpad: Extend the touchpad gesture API with pinch gestures
Extend the touchpad gesture API with pinch gestures. Note that this
new API offers a single event stream for both pinch and rotate data, this
is deliberate as some applications may be interested in getting both at
the same time. Applications which are only interested in one or the other
can simply ignore the other.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Jason Gerecke <jason.gerecke@wacom.com>
2015-07-06 14:09:27 +10:00
Hans de Goede
b8a2e5bc5f touchpad: Add an API for touchpad gesture events
For touchscreens we always send raw touch events to the compositor, and the
compositor or application toolkits do gesture recognition. This makes sense
because on a touchscreen which window / widget the touches are over is
important context to know to interpret gestures.

On touchpads however we never send raw events since a touchpad is an absolute
device which primary function is to send pointer motion delta-s, so we always
need to do processing (and a lot of it) on the raw events.

Moreover there is nothing underneath the finger which influences how to
interpret gestures, and there is a lot of touchpad and libinput configuration
specific context necessary for gesture recognition. E.g. is this a clickpad,
and if so are softbuttons or clickfinger used? What is the size of the
softbuttons? Is this a true multi-touch touchpad or a semi multi-touch touchpad
which only gives us a bounding box enclosing the fingers? Etc.

So for touchpads it is better to do gesture processing in libinput, this commit
adds an initial implementation of a Gesture event API which only supports swipe
gestures, other gestures will be added later following the same model wrt,
having clear start and stop events and the number of fingers involved being
fixed once a gesture sequence starts.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Jason Gerecke <jason.gerecke@wacom.com>
2015-07-06 14:08:54 +10:00
Peter Hutterer
9610ff849e Merge branch 'master' into tablet-support 2015-06-29 13:56:05 +10:00
Peter Hutterer
b7c414558d tools: pass a context around as userdata
We need the options during open_restricted(), so instead of the caller just
passing in a custom userdata, let them wrap it into a tools_context.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-06-24 15:15:15 +10:00
Peter Hutterer
41ad79f8d8 tools: move the interface into the shared code
No need to duplicate this atm

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-06-24 15:15:07 +10:00
Peter Hutterer
0d322c69d0 Merge branch 'master' into tablet-support 2015-06-22 15:20:01 +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
087d25a54e Merge branch 'master' into tablet-support 2015-05-22 14:21:21 +10:00
Peter Hutterer
f877ff2f96 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>
2015-04-22 15:31:21 +10:00
Peter Hutterer
c621656790 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>
2015-04-10 15:53:13 +10:00
Peter Hutterer
29ba32b330 0.13.0
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iEYEABECAAYFAlURAX0ACgkQ4jt+cLRn8L9oeQCfUkFNZCSYwEGiuBQfx6wgGfBD
 vWgAoLiQ7zVV5Vko9NE4Lu4hPkt7UQ21
 =LvzY
 -----END PGP SIGNATURE-----

Merge tag '0.13.0' into tablet-support
2015-04-07 07:52:43 +10:00
Peter Hutterer
1ed07fedce 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>
2015-03-20 08:47:39 +10:00
Peter Hutterer
115e68476e Merge branch 'master' into tablet-support 2015-02-20 10:16:21 +10:00
Peter Hutterer
002ef1635d cosmetic: drop double empty lines
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-02-20 09:57:39 +10:00
Stephen Chandler Paul
c7948e3bb5 tablet: Merge PROXIMITY_IN and PROXIMITY_OUT into a single event
There isn't much purpose in having proximity in and out as different events,
combining them into one single event is more consistent with the rest of the
API, and means less code for clients to have to work with.

Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-02-18 13:27:29 +10:00
Peter Hutterer
633d01d146 0.9.0
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iEYEABECAAYFAlTLBSIACgkQ4jt+cLRn8L+4NgCgmgMNoZnmHfNJooSdrRQxzs2t
 8c0An1jHFRAO+9/47m2l2tAzXV2RBaf6
 =b46e
 -----END PGP SIGNATURE-----

Merge tag '0.9.0' into tablet-support

0.9.0

Conflicts:
	test/litest.h
2015-02-05 15:05:36 +10:00
Friedrich Schöller
529ce8e4ac tools: Check if axis value is available in debugging GUI
libinput complained with lots of "client bug" messages because the GUI tool
did not check which axis values were available.

Signed-off-by: Friedrich Schöller <code@schoeller.se>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-01-27 13:34:23 +10:00
Friedrich Schöller
4a90910895 tools: Use correct event axis in debugging GUI
Vertical axis values were used for the horizontal axis as well.

Introduced 1baf109b40

Signed-off-by: Friedrich Schöller <code@schoeller.se>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-01-27 12:29:52 +10:00
Peter Hutterer
395c449c8e Merge branch 'master' into tablet-support
Conflicts:
	src/libinput.h
2015-01-16 07:55:23 +10:00
Peter Hutterer
1baf109b40 Change axis events to carry all directions
Sending separate axis events instead of one unified events is limiting,
especially when simultaneously scrolling in both directions and the caller
tries to implement kinetic scrolling.

Take a page from the tablet-support branch and instead implement the axis
event as a generic event that can contain multiple axes simultaneously.

Right now we only have two (scroll) axes and we could easily just check both
for non-zero values. If we want to allow further axes in the future, we need
a check whether an axis is set in an event, that's what
libinput_event_pointer_has_axis to scroll events() is for.

We also need the mask to notify of a scroll stop event, which could otherwise
be confused as a vertical-only or horizontal-only event.

This is an API and ABI break.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-01-13 13:54:21 +10:00
Peter Hutterer
df47231719 tools: pass the userdata to the context
The event-gui needs this but it got dropped in
6ee8c585, causing a crash. Oops.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-12-23 11:14:39 +10:00
Peter Hutterer
6ee8c5854c tools: use the new shared lib from event-gui
This gives the event gui the ability to use the path backend, and any
configuration toggles given on the commandline.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-12-23 10:50:31 +10:00
Peter Hutterer
83f97991a0 0.7.0
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iEYEABECAAYFAlSBMWUACgkQ4jt+cLRn8L/4JQCgt0u/hImDVk9GLPXpUfFZinRc
 pIgAn1bZ91n/o4nEhq6zOXSsKRoZvxHL
 =oj19
 -----END PGP SIGNATURE-----

Merge tag '0.7.0' into tablet-support

0.7.0

Conflicts:
	src/libinput-private.h
	test/device.c
	test/litest.h
2014-12-08 11:14:11 +10:00
Peter Hutterer
b7c324ba32 tools: print the device name on DEVICE_ADDED
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-11-20 08:11:42 +10:00
Peter Hutterer
fb5f44f794 tools: map KEY_UP/DOWN to pointer acceleration
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-09-23 10:46:40 +10:00