summaryrefslogtreecommitdiff
path: root/src/libinput.h
AgeCommit message (Collapse)AuthorFilesLines
2015-12-02tablet: drop the tool type 'finger' from the tablet interfacePeter Hutterer1-1/+0
If it's a finger, it's a touchscreen or a touchpad, not a tablet. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-11-18doc: tablet documentation updatesPeter Hutterer1-1/+4
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-11-18tablet: rename the libinput_tool calls to libinput_tablet_toolPeter Hutterer1-17/+17
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-11-18tablet: rename libinput_event_tablet to libinput_event_tablet_toolPeter Hutterer1-33/+33
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-11-18tablet: rename LIBINPUT_EVENT_TABLET to LIBINPUT_EVENT_TABLET_TOOLPeter Hutterer1-23/+23
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-11-18tablet: rename the tablet capability to a tablet_tool capabilityPeter Hutterer1-9/+9
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-11-18tablet: rename TOOL_TIP to TABLET_TOOL_TIPPeter Hutterer1-2/+2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-11-18tablet: rename tool_tip_state to tablet_tool_tip_statePeter Hutterer1-2/+2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-11-18tablet: rename TOOL_PROXIMITY_ to TABLET_TOOL_PROXIMITYPeter Hutterer1-4/+4
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-11-18tablet: rename tool_proximity_state to tablet_tool_proximity statePeter Hutterer1-2/+2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-11-18tablet: rename TOOL_TYPE to TABLET_TOOL_TYPEPeter Hutterer1-13/+13
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-11-18tablet: rename libinput_tool_type to libinput_tablet_tool_typePeter Hutterer1-3/+3
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-11-18tablet: rename the tablet axes to "LIBINPUT_TABLET_TOOL_AXIS_..."Peter Hutterer1-18/+18
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-11-18tablet: rename libinput_tablet_axis to libinput_tablet_tool_axisPeter Hutterer1-6/+6
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-11-18tablet: rename libinput_tool to libinput_tablet_toolPeter Hutterer1-13/+13
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-11-12tablet: split out tip handling into a separate eventPeter Hutterer1-0/+41
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-12tablet: clarify tablet axis behavior in regards to proximityPeter Hutterer1-0/+7
We send the axis state in the proximity event so we don't send another axis event for the same state. The first axis event is sent whenever the tool moves. This is largely of note for test cases, in real-world usage a tool cannot be held still enough to never send axis updates. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-11-09tablet: widen the tool id to 64 bitsPeter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-11-09tablet: rename all tool types to LIBINPUT_TOOL_TYPE_*Peter Hutterer1-14/+15
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
2015-11-05tablet: widen the serial type to uint64_tPeter Hutterer1-1/+1
Internally we still use uint32_t because that's all we get from evdev. But eventually we'll have 64 bit serials. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
2015-10-21Merge branch 'master' into tablet-supportPeter Hutterer1-0/+94
2015-09-11Add an API to change pointer acceleration profilesPeter Hutterer1-0/+74
The quartett of new config functions is: libinput_device_config_accel_get_profiles libinput_device_config_accel_get_profile libinput_device_config_accel_set_profile libinput_device_config_accel_get_default_profile The profile defines how the pointer acceleration works, from a very high-level perspective. Two profiles are on offer, "adaptive", the standard one we have used so far and "flat" which is a simple multiplier of input deltas and provides 1:1 mapping of device movement vs pointer movement. The speed setting is on top of the profile, a speed of 0 (default) is the equivalent to "no pointer acceleration". This is popular among gamers and users of switchable-dpi mice. The flat profile unnormalizes the deltas, i.e. you get what the device does and any device below 800dpi will feel excruciatingly slow. The speed range [-1, 1] maps into 0-200% of the speed. At 200%, a delta of 1 is translated into a 2 pixel movement, anything higher makes it rather pointless. The flat profile is currently available for all pointer devices but touchpads. https://bugs.freedesktop.org/show_bug.cgi?id=89485 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-09-04Note that libinput_unref() really destroys everythingPeter Hutterer1-0/+20
This is both a bug and required behavior. A caller may hold refcounted references to devices, seats, or device groups but when libinput_unref() cleans up, all these become invalid. It is required behavior, because the last call to libinput_unref() also calls libinput_suspend() and thus stops any events. Any attempt at fixing this will break current behavior: * keeping structs until all refcounts are 0 may leak memory in current callers * it would require an explicit call to libinput_suspend(), or make libinput_unref() inconsistent in its behavior. So we document it as a bug and tell people not to do it. https://bugs.freedesktop.org/show_bug.cgi?id=91872 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
2015-08-26Merge branch 'master' into tablet-supportPeter Hutterer1-4/+8
2015-08-21doc: inverse event type restriction of x and y accessorsAndreas Pokorny1-4/+8
Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-08-04tablet: add get_time_usec() for tablets, switch to usecPeter Hutterer1-0/+9
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-08-04Merge branch 'master' into tablet-supportPeter Hutterer1-0/+32
2015-07-28Change to micro seconds for measuring time internallyJonas Ådahl1-0/+32
In order to provide higher precision event time stamps, change the internal time measuring from milliseconds to microseconds. Microseconds are chosen because it is the most fine grained time stamp we can get from evdev. The API is extended with high precision getters whenever the given information is available. Signed-off-by: Jonas Ådahl <jadahl@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-24Merge branch 'master' into tablet-supportPeter Hutterer1-0/+90
2015-07-24Add a configuration interface for enabling/disabling disable-while-typingPeter Hutterer1-0/+90
DWT can interfere with some applications where keyboard and touchpad use at the same time is common, e.g. games but also anything that requires a combination of frequent pointer motion and use of keyboard shortcuts. Expose a toggle to disable DWT where needed. https://bugs.freedesktop.org/show_bug.cgi?id=90624 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-07-09doc: drop a confusing notePeter Hutterer1-8/+0
This note doesn't add anything, the delta to the last changed is the same as the delta to the last event, otherwise it'd be 0. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-09doc: improve the tablet documentationPeter Hutterer1-8/+31
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-08Merge branch 'master' into tablet-supportPeter Hutterer1-2/+209
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-06doc: add documentation for touchpad gesturesPeter Hutterer1-0/+2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-06gestures: allow any gesture event type for gesture_get_dx/dy and get_anglePeter Hutterer1-19/+0
For start/end, dx/dy is always 0.0, and there is no need to make calling this function for start/end a caller bug. It just unnecessarily complicates the caller's codepath. Same for get_angle Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-06gestures: check for valid types on the gesture event APIPeter Hutterer1-2/+11
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-07-06touchpad: Allow querying whether a gesture ended normally or was cancelledHans de Goede1-0/+17
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2015-07-06touchpad: Extend the touchpad gesture API with pinch gesturesHans de Goede1-12/+68
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-06touchpad: Add an API for touchpad gesture eventsHans de Goede1-2/+146
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-06Merge branch 'master' into tablet-supportPeter Hutterer1-12/+14
2015-07-02Drop motion normalization of unaccelerated deltasPeter Hutterer1-12/+14
This simply doesn't work for low-dpi mice. Normalizing a 400dpi mouse to a 1000dpi mouse forces a minimum movement of 2.5 units and the resulting pixel jumps. It is impossible for the caller to detect whether the jump was caused by a single motion or multiple motion events. This is technically an API break, but not really. The accelerated data was already relatively meaningless, even if normalized as the data did not correspond predictably to any input motion (unless you know the implementation acceleration function in the caller). So we can drop the mention from there without expecting any ill effects in the caller. The unaccelerated data was useless for low-dpi mice and could only be used to measure the physical distance of the mouse movement - something not used in any caller we're aware of (if needed, we can add that functionality as a separate call). Dropping motion normalization for unaccelerated deltas also restores true dpi capabilities to users of that API, mostly games that want to make use of high-dpi mice. This is a simplified patch, the normalization is still in place for most of libinput, it merely carries the original coordinates in the event itself. In the case of touchpads, the coordinates are unnormalized into the x-axis coordinate space as per the documentation. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-06-29Merge branch 'master' into tablet-supportPeter Hutterer1-0/+81
2015-06-26Add missing @ingroup tag to the logging priority enumPeter Hutterer1-0/+2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-06-23Add configuration interface for tap drag-lockPeter Hutterer1-0/+79
In some applications, notably Inkscape, where it is common to frequently drag objects a short distance the default to drag-lock always-on is frustrating for users. Make it configurable, with the current default to "on". New API: libinput_device_config_tap_set_drag_lock_enabled libinput_device_config_tap_get_drag_lock_enabled libinput_device_config_tap_get_default_drag_lock_enabled Any device capable of tapping is capable of drag lock, there is no explicit availability check for drag lock. Configuration is independent, drag lock may be enabled when tapping is disabled. In the tests, enable/disable drag-lock explicitly where the tests depend on it. https://bugs.freedesktop.org/show_bug.cgi?id=90928 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-06-22Merge branch 'master' into tablet-supportPeter Hutterer1-18/+20
2015-06-18Fix documentation for tap_get_enabled()Peter Hutterer1-1/+2
Technically we return LIBINPUT_CONFIG_TAP_DISABLED, which is 0. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-06-16COPYING: Update boilerplate from MIT X11 to MIT Expat licensePeter Hutterer1-17/+18
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-04Merge branch 'master' into tablet-supportPeter Hutterer1-0/+1
2015-05-28Update Red Hat's copyrightPeter Hutterer1-0/+1
Updated to 2015 where appropriate, added where missing. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-27tablet: add missing libinput_event_tablet_get_base_eventPeter Hutterer1-0/+8
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>