Commit graph

66 commits

Author SHA1 Message Date
Peter Hutterer
ec8b703c9c tools: only print the tablet axes we have on the tool
Split out the actual axis printing into a helper function and call that from
the main tablet proximity/axis print functions.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Reviewed-by: Stephen Chandler Paul <thatslyude@gmail.com>
2015-03-02 13:20:44 +10:00
Peter Hutterer
0af9aeba8c tools: print tool capabilities on proximity
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Reviewed-by: Stephen Chandler Paul <thatslyude@gmail.com>
2015-03-02 13:20:44 +10:00
Peter Hutterer
0d87dd8121 tablet: support airbrush wheel as slider
The little wheel isn't a full wheel, it has a ~90 degree rotation angle with a
range of 1024 values. To avoid confusion with "wheel" elsewhere in the API
name it slider.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Stephen Chandler Paul <thatslyude@gmail.com>
2015-03-02 13:20:44 +10:00
Peter Hutterer
8edae426e3 tablet: support z-rotation for the mouse/lens tool
Needs to be calculated from the x/y tilt values, the mouse has a fixed offset
of 175 degrees counterclockwise.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Reviewed-by: Stephen Chandler Paul <thatslyude@gmail.com>
2015-03-02 13:20:44 +10:00
Peter Hutterer
585c30e01e tablet: drop LIBINPUT_TOOL_NONE from the public API
This is only used internally.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Reviewed-by: Stephen Chandler Paul <thatslyude@gmail.com>
2015-03-02 13:19:00 +10:00
Peter Hutterer
52997faf45 Merge branch 'master' into tablet-support
Conflicts:
	src/libinput.sym
2015-02-18 15:14:26 +10:00
Stephen Chandler Paul
b5d6be3cd6 tablet: Include starting values of axes in proximity events
Having a motion event that's sent right after the original proximity event just
to give the values of each axis is somewhat redundant. Since we already include
the values of each axis with each type of event, we may as well use the
proximity event to give the client the starting values for each axis on the
tablet.

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:59:14 +10:00
Stephen Chandler Paul
3aeae35a60 event-debug: Increase spacing after the event-type
TABLET_PROXIMITY events cause many terminals to push every column to the right
by one additional tab, this just increases the space after the event type so
that everything lines up again.

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
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
f0d7eaf11e tools: print the device group in event-debug
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-02-18 09:47:41 +10:00
Peter Hutterer
90918f77e6 tools: print the tablet capability as 'T' in event-debug
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-02-10 15:25:57 +10:00
Peter Hutterer
395c449c8e Merge branch 'master' into tablet-support
Conflicts:
	src/libinput.h
2015-01-16 07:55:23 +10:00
Stephen Chandler Paul
2af608cf02 Rename functions for left handed device configurations
Some devices require more than just flipping around the buttons, such as
tablets.
When it comes to devices like tablets, because the position of the palm rest is
on the right, the entire tablet has to be flipped around in order to be usable
by lefties. As such, this requires that we reverse the coordinates of the
tablets in addition to flipping the buttons on the tablet. As such, renaming
these functions so that they aren't specific to devices where only the buttons
are flipped seems appropriate.

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-01-15 10:17:57 +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
fe8e6706bd tools: switch signal handler in event-debug
Under gdb, signalfd will still deliver the signal when gdb itself is
interrupted and quit event-debug. For a debugging tool, that's not optimal.
Switch to a normal signal handler instead, signalfd is overkill here anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
2015-01-08 13:19:55 +10:00
Peter Hutterer
01b0c8fbf5 tools: fail if we can't set up signal handlers in event-debug
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-01-08 09:52:08 +10:00
Peter Hutterer
f11cd30f00 tools: print device capabilities in event-debug
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-01-05 08:57:22 +10:00
Peter Hutterer
9c297aefae tools: change name/seat/logical seat format string
Change the seat field widths to match the usual seat0/default. This compresses
the output a bit, we're printing too much already.

Also, one of my mice has >30 chars, it's annoying to look at. Fix this.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-01-05 08:57:14 +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
b8e63b54d3 tools: move applying device configuration to shared lib
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-12-23 10:50:31 +10:00
Peter Hutterer
3628f7016e tools: move opening the backend to the shared lib too
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-12-23 10:50:31 +10:00
Peter Hutterer
e205615c98 tools: move option parsing to a helper library
event-debug and event-gui can and should share this

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-12-23 10:50:31 +10:00
Peter Hutterer
bc6925d6c2 tools: add --enable-tap to event-debug
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-12-23 10:50:31 +10:00
Peter Hutterer
93a2cb21e0 tools: make event-debug's option parsing more flexible
We need to be able to turn config options on/off for testing, so switch to
something that's a bit more flexible than characters that represent the
options.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-12-23 10:50:31 +10:00
Peter Hutterer
0343a62a9f tools: add --help to event-debug's usage
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-12-18 15:40: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
92d178f167 Rename scroll_mode to scroll_method
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-11-24 10:58:23 +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
3178a3ae75 tools: print config options for each device 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:40 +10:00
Peter Hutterer
0891bc0d92 Merge branch 'master' into tablet-support 2014-07-21 09:31:37 +10:00
Jonas Ådahl
85c4500494 event-debug: Silence compiler warnings
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2014-07-15 23:44:50 +02:00
Stephen Chandler Paul
43356a2979 tablet: Rename TILT_VERTICAL and TILT_HORIZONTAL to TILT_X and TILT_Y
Since the orientation of the tablet can potentially change, this naming scheme
makes a lot more sense then VERTICAL and HORIZONTAL does since they don't
reflect the actual physical movement.

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>
2014-07-10 14:24:13 +10:00
Stephen Chandler Paul
8b1b988fd8 tablet: Replace tool-update with proximity-in
A proximity-in event is something we want, especially since the current drafted
wayland spec has a proximity-in event. Adding this also makes our events more
consistent. And since we can just report the current tool in use with
proximity-in events, we can get rid of the tool-update event.

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>
2014-06-27 12:08:31 +10:00
Peter Hutterer
8302b0b7e3 Merge branch 'master' into tablet-support
Conflicts:
	src/libinput-util.h
	test/misc.c
2014-06-25 14:43:45 +10:00
Peter Hutterer
bad56cac5b Merge branch 'ref-counting-context'
Conflicts:
	src/udev-seat.c
	test/log.c
2014-06-25 10:32:42 +10:00
Jonas Ådahl
faab25c25c Make context reference counted
Instead of only allowing one owner keeping a libinput context alive,
make context reference counted, replacing libinput_destroy() with
libinput_unref() while adding another function libinput_ref().

Even though there might not be any current use cases, it doesn't mean we
should hard code this usage model in the API. The old behaviour can be
emulated by never calling libinput_ref() while replacing
libinput_destroy() with libinput_unref().

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-06-25 10:27:03 +10:00
Peter Hutterer
97a6bf10f9 Change the logging system to be per-context
Rather than a single global logging function, make the logging dependent on
the individual context. This way we won't stomp on each other's feet in the
(admittedly unusual) case of having multiple libinput contexts.

The userdata argument to the log handler was dropped. The caller has a ref to
the libinput context now, any userdata can be attached to that context
instead.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-06-23 15:39:08 +10:00
Peter Hutterer
6250397ac8 udev: split libinput_udev context init into two functions
This is preparation work for context-specific log handlers.

Callers are now encouraged to first initialize the context with
libinput_udev_create_context() and then set the seat for this context with
libinput_udev_assign_seat().

In the upcoming patch to support context-specific log handlers this enables a
caller to set the log handler for a context before any devices are
initialized. Otherwise, a log message generated by a new device may pass a
libinput context that the caller is not yet aware of.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-06-23 15:39:08 +10:00
Peter Hutterer
967911791f Rename KEYBOARD_KEY_STATE to KEY_STATE
e912d620d0 changed from POINTER_BUTTON_STATE to
simply BUTTON_STATE, replicate that for key events too.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-06-23 15:23:35 +10:00
Peter Hutterer
55bf505807 Name-space the scroll event types
To provide a generic naming system of type_direction. That will become more
important once we add new axes as part of the ongoing work to support graphics
tablets.

[edit: and switch to the new defines]

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-06-23 14:31:56 +10:00
Peter Hutterer
bb1dd896ac Merge branch 'master' into tablet-support 2014-06-23 10:08:18 +10:00
Peter Hutterer
41f9176c0a Add a function to get the size of a device
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-06-19 13:38:15 +10:00
Peter Hutterer
21cf84a580 Change absolute and touch events to use mm as default unit
Instead of device-specific coordinates that the caller can't interpret without
knowing the range anyway, return mm as the default value.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2014-06-19 13:38:15 +10:00
Peter Hutterer
8f9730872d tools: print tablet axis debugging on one line
Print all axes on the same line, with a * for those that changed. This makes
changes on axes a lot more obvious than when broken up per line.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-06-18 15:55:20 +10: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
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
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
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
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
e912d620d0 s/libinput_pointer_button_state/libinput_button_state/
Button states are applicable to more then just the pointer, so having a
non-generic name name for a generic enumerator value like
libinput_pointer_button_state doesn't make sense. Changing it to something
generic like libinput_button_state allows it to be reused by other devices that
may potentially be added to libinput in the future.

Signed-off-by: Stephen Chandler Paul <thatslyude@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-06-09 20:48:05 +02:00