summaryrefslogtreecommitdiff
path: root/src/libinput.h
AgeCommit message (Collapse)AuthorFilesLines
2017-05-04Merge branch 'wip/touchpad-tap-timestamps'Peter Hutterer1-0/+42
2017-05-02doc: fix doxygen group for libinput_event_tablet_pad_get_timePeter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-05-02doc: document the event timestampsPeter Hutterer1-0/+42
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-04-25Add doc to discourage use of libinput_device_get_output_name()Peter Hutterer1-0/+8
This is a leftover from when libinput was part of weston and we could interpret properties correctly. Realistically, the only way this could work with libinput as external library is if we define precisely what the definition of an output is. Practically, it's a lot easier to just throw up our hands and leave it all to the caller. https://bugs.freedesktop.org/show_bug.cgi?id=100707 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-02-21Add the matching @see tags to the accel configPeter Hutterer1-0/+16
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-26Clarify the default 'off' position of a switchPeter Hutterer1-1/+5
So we don't need to send an "off" event for every switch on startup. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-26Add a "switch" interface for parts of the SW_* rangeJames Ye1-0/+112
This will allow switch devices known to libinput to be exposed. Currently, this is SW_LID. libinput also handles switch events internally, e.g. a laptop touchpad will be disabled autmoatically when the lid is closed. This is transparent to the caller, although the caller will also receive the event. See https://bugs.freedesktop.org/show_bug.cgi?id=86223 This features is intended to be the main driver for the interface. Co-Authored-By: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: James Ye <jye836@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-20Merge branch 'wip/wheel-tilt-source'Peter Hutterer1-0/+15
2017-01-18Fix typos in DocumentationRohith Mukku1-4/+4
Signed-off-by: Rohith Mukku <rohithmukku@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-16Fix doxygen references for natural scroll configPeter Hutterer1-12/+12
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-04Add wheel tilt as axis sourcePeter Hutterer1-0/+15
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-08-15Add configurable button map to tappingsPeter Hutterer1-0/+82
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-15doc: split middle button emulation into a separate pagePeter Hutterer1-16/+7
Easier to link to from bug reports Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-07-11Remove LIBINPUT_EVENT_TABLET_PAD_MODE eventPeter Hutterer1-13/+0
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-11Fix and improve mode group documentationPeter Hutterer1-18/+29
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-07-04Merge branch 'wip/tablet-pad-modes-v3'Peter Hutterer1-139/+437
2016-07-04touchpad: remove software middle button when emulation is enabledPeter Hutterer1-0/+4
Expose the middle button emulation on software buttons as proper config option. When enabled, remove the middle button software button area. https://bugs.freedesktop.org/show_bug.cgi?id=96663 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-06-22pad: Add a new API for modes and mode groupsPeter Hutterer1-0/+290
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-22doc: move the struct declarations to the topPeter Hutterer1-126/+126
They don't define anything, move them to the top so we don't have ordering requirements of the stuff that actually uses those as parameters. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Yong Bakos <ybakos@humanoriented.com> Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com> Reviewed-by: Carlos Garnacho <carlosg@gnome.org>
2016-06-22doc: split the tablet pad events into their own doxygen module pagePeter Hutterer1-15/+23
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Yong Bakos <ybakos@humanoriented.com> Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com> Reviewed-by: Carlos Garnacho <carlosg@gnome.org>
2016-05-24doc: update ref/unref behavior for the tablet toolPeter Hutterer1-4/+7
Brings it in line with the rest of libinput. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-24doc: update doc to explicitly state that the seat isn't referencedPeter Hutterer1-0/+5
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-19doc: fix a few typosPeter Hutterer1-2/+3
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-16Add support for relative device rotation (trackball only)Peter Hutterer1-0/+96
Trackballs are effectively stationary devices and can be positioned at any rotation. They are also employed by users with impaired dexterity which sometimes implies that they are positioned at an non-default angle to make the buttons easier to reach. Add a config option for rotation for trackball devices. Currently only supported for 90-degree angles, if there is a need we can add more angles later. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-05-03doc: add an overview of the various configuration optionsPeter Hutterer1-0/+26
It's a bit hard to find what can be configured in the wall of text that is the doxygen output. Add a TOC of the various options so it's easy to get a quick grasp. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-05-03doc: add missing @ingroup tag to the accel profile enumPeter Hutterer1-0/+3
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-04-18Add the LIBINPUT_DEVICE_CAP_TABLET_PAD capability and matching interfacePeter Hutterer1-1/+312
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-06Fix spelling mistakesEric Engestrom1-4/+4
Signed-off-by: Eric Engestrom <eric@engestrom.ch> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-03-29Fix two doxygen groupingsPeter Hutterer1-1/+3
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-11test: add tablet test for out-of-bounds motion coordinatesPeter Hutterer1-0/+12
The newer Cintiqs have a minimum value of 400/400 advertised by the kernel but the actual sensor goes past the 0/0 origin. Test this, make sure that a value outside the boundaries generates negative mm values. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-02-09tablet: change tilt axes to use degreesPeter Hutterer1-4/+12
The Wacom tilt range is 64 degrees so we map everything into that until we know otherwise. This commit also switches the tilt axes around to align the angles with the x/y orientation, i.e. tilting the top of the stylus towards the positive x axis now generates a positive x tilt. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
2016-02-04doc: be more specific about tablet vs tablet toolPeter Hutterer1-61/+63
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-01-27Merge branch 'master' into tablet-supportPeter Hutterer1-0/+73
2016-01-27touchpad: add a config option to disable tap-and-dragPeter Hutterer1-0/+73
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-22tablet: add support for relative x/y motion deltasPeter Hutterer1-0/+34
Instead of an explicit tablet mode that device must be changed into, let the caller decide which coordinates are preferred. The tablet mode may be application-specific and usually depends on the tool as well. This patch adds an interface to get a motion delta for the x/y axes in pixel-like coordinates. libinput provides some magic to convert the tablet data into something that resembles pixels from a mouse motion. For unaccelerated relative motion, the caller should use the mm values from the tablet and calculate deltas manually. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Jason Gerecke <jason.gerecke@wacom.com>
2016-01-19Merge branch 'master' into tablet-supportPeter Hutterer1-0/+2
2016-01-15tablet: allow the various get_<axis> on tablet button eventsPeter Hutterer1-9/+18
There's no reason to prevent this for button events. Unlike the pointer which is a relative device a tablet is (usually) a device with a lot of state. Caller code that handles axes is likely shared between the various events, treating button events separately here doesn't get us any benefit. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Jason Gerecke <jason.gerecke@wacom.com>
2016-01-11tablet: a tip event can replace an axis eventPeter Hutterer1-2/+26
When we're only dealing with BTN_TOUCH we can make the tip event independent of the axis event. Now that we handle pressure thresholds to trigger tip state this does not work, we'd have to send an axis event with the new pressure and then a tip event. Since the pressure triggers the tip event this seems disconnected. Make the tip event officially capable of carrying axes. A caller can then decide how to forward this to the next layer. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Jason Gerecke <jason.gerecke@wacom.com>
2016-01-11doc: fix two grammar issues "of tablet tool" -> "of the tablet tool"Peter Hutterer1-4/+4
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-01-06tablet: insert "STATE" into proximity/tip statesPeter Hutterer1-4/+4
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-05doc: add missing tip event to the allowed set of eventsPeter Hutterer1-18/+38
We can call the various has_changed() functions on a tip event. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-01-05doc: fix and improve the tablet documentationPeter Hutterer1-14/+28
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-12-23tablet: add libinput_tablet_tool_is_unique()Peter Hutterer1-6/+18
For checking if a tablet tool can be uniquely identified by libinput. In practice this means checking for a nonzero serial number, but let's not restrict ourselves to allowing just that. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-12-22doc: add missing @config tag to libinput_config_send_event_modesPeter Hutterer1-0/+2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-12-21tablet: remove the libinput_tablet_tool_axis enum from the public APIPeter Hutterer1-21/+0
Internally we still use it, at least for now. 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-21tablet: reduce event deltas to only apply to the wheelPeter Hutterer1-23/+14
Part of the big revamp to get rid of libinput_tablet_tool_axis and replace it with a set of axis-specific APIs. Only the rel wheel has true delta events, everything else is a delta calculated by libinput based on the previous position. Since we supply that position to the callers anyway, they can determine that delta themselves where needed. 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-21tablet: rename libinput_tablet_tool_has_axis into an axis-specific API setPeter Hutterer1-5/+58
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 check whether a tablet has an x or y axis. If it doesn't, libinput won't initialize the tablet anyway so this was superfluous already. Likewise with the tilt axes - either we have x and y tilt or we have neither, so separate checks for tilt_x and tilt_y is unnecessary. 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-21tablet: rename axis_get_value into an axis-specific API setPeter Hutterer1-34/+109
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-21tablet: rename axis_has_changed into an axis-specific API setPeter Hutterer1-9/+150
First part of the big revamp to get rid of libinput_tablet_tool_axis and replace it with a set of axis-specific APIs. 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-15doc: a couple of tablet documentation fixesPeter Hutterer1-24/+28
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>