summaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)AuthorFilesLines
21 hourstools: actually parse options in libinput-debug-tabletsHEADmainPeter Hutterer1-0/+6
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1009>
21 hoursAdd support for --set-pressure-range to the debugging toolsPeter Hutterer6-3/+53
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1009>
7 daystools/record: record the DRIVER property in the recordingPeter Hutterer2-6/+15
So we know which kernel driver is handling the device. Quite useful, sometimes, without having to ask for extra logs. This of course requires that we ignore said property in libinput replay since no uinput device will have that driver property set. Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1007>
2024-04-09touchpad: add clickfinger button mapTarcísio Eduardo Moreira Crocomo4-0/+23
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/988>
2024-03-18sparse: make some variables staticJosé Expósito1-1/+1
Fix warnings about variables that should be made static when compiling with Sparse enabled: $ CC=cgcc meson builddir Signed-off-by: José Expósito <jose.exposito89@gmail.com> Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/987>
2024-03-18tools: fix two black warningsPeter Hutterer2-2/+2
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/985>
2024-02-20tablet: add API for relative dialsJoshua Goins3-6/+55
Some tablets such as those in the XP-PEN PRO series use "dials" which are actually scrollwheels and emit EV_REL events. These should not be emulated as rings (which are absolute) so we must expose them as a new tablet event. Adds LIBINPUT_EVENT_TABLET_PAD_DIAL that work largely identical as our high-resolution wheel events (i.e. the values are in multiples or fractions of of 120). Currently supports two dials. This is a lot of copy/paste from the ring axes because the interface is virtually identical. The main difference is that dials give us a v120 value in the same manner as our scroll axes. Notes: - REL_DIAL is mutually exclusive with REL_WHEEL, we assume the kernel doesn't (at this point) give us devices with both. If this changes for devices with three dials (wheel + hwheel + dial) we need to add code for that. - REL_DIAL does not have a high-resolution axis and we assume that any device with REL_WHEEL_HI_RES will also have REL_HWHEEL_HI_RES (if the second wheel exists). - With dials being REL_DIAL or REL_WHEEL there is no possibility of detecting a finger release (the kernel does not route EV_RELs with a value of zero). Unless this is implemented via a side-channel - and it doesn't look like any hardware that supports dials does that - we cannot forward any information here. So unlike absolute rings we cannot provide a source information here. Closes #600 Co-authored-by: Peter Hutterer <peter.hutterer@who-t.net> Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/967>
2023-10-16Number the fingers by slot in debug-guiCzcibor Bohusz-Dobosz1-1/+13
2023-09-01tools/record: print bus nameJosé Expósito1-2/+27
A follow up on commit 65eaabf91f58 ("tools/record: print the vid/pid with proper 4 hex digits"). Print the bus name in addition to the bus ID. Only the busses available in quirks are printed. Example: $ sudo libinput record [...] # ID: bus 0x0003 (usb) vendor 0x046d product 0x406d version 0x0111 [...] Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2023-08-31tools: rename an enum value to fix a FreeBSD 14 name clashPeter Hutterer1-2/+2
Fixes #931
2023-08-29evdev: add a helper macro for the absinfo rangePeter Hutterer1-1/+2
The range is (max - min + 1) because the kernel range is inclusive min and max. Let's fix that once and for all with a helper function. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-08-29tools/record: print the vid/pid with proper 4 hex digitsPeter Hutterer1-1/+1
The field with includes the 0x if printing with "0x04d". And because that format prints zero as just 0000, let's move the 0x prefix out and let printf only handle the actual number. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-06-09man: hide debug-gui from the libinput.man page if disabledPeter Hutterer1-3/+3
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-04-27tools: add rotation support to debug-events and debug-guiPeter Hutterer4-1/+19
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-04-27test: carry the step as argument for arg testingPeter Hutterer1-5/+3
Simplifies things a bit since it makes it all more explicit Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-04-20tools/debug-gui: fix a deprecated warningPeter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-04-20tools: fix a few scan-build dead store warningsPeter Hutterer2-4/+4
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-04-11tools: add a tool to update our Razer quirks for internal keyboardsPeter Hutterer1-0/+83
openrazer keeps a convenient list of keyboard devices that belong to the RazerBlade line and thus should be marked as internal by us. Let's use that one. This script git clones the current openrazer repo, imports the file we need and then overwrites our current quirks file with the sorted list of devices. For the second part of this to work reliable we need a marker in the quirks file that marks the start of autogenerated entries. Heavily influenced by @danryu in !887. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-03-20tools: honor FDO_CI_CONCURRENT in the tools option parserPeter Hutterer1-1/+2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-02-24filter: add scroll movement type to the custom acceleration profileYinon Burgansky2-2/+4
Adds a dedicated scroll movement type to the custom acceleration profile. Supported by physical mouse and touchpad. Other profiles remain the same by using the same unaccelerated filter for the scroll filter. Signed-off-by: Yinon Burgansky <51504-Yinon@users.noreply.gitlab.freedesktop.org>
2023-02-06tools: add --replay-after and --once to libinput replayPeter Hutterer2-1/+26
For the cases where it's not possible to hit enter to start the replay because e.g. we cannot change focus, etc. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-01-17Introduce custom acceleration profileYinon Burgansky5-5/+135
The custom acceleration profile allow the user to define custom acceleration functions for each movement type per device, giving full control over accelerations behavior at different speeds. This commit introduces 2 movement types which corresponds to the 2 profiles currently in use by libinput. regular filter is Motion type. constant filter is Fallback type. This allows possible expansion of new movement types for the different devices. The custom pointer acceleration profile gives the user full control over the acceleration behavior at different speeds. The user needs to provide a custom acceleration function f(x) where the x-axis is the device speed and the y-axis is the pointer speed. The user should take into account the native device dpi and screen dpi in order to achieve the desired behavior/feel of the acceleration. The custom acceleration function is defined using n points which are spaced uniformly along the x-axis, starting from 0 and continuing in constant steps. There by the points defining the custom function are: (0 * step, f[0]), (1 * step, f[1]), ..., ((n-1) * step, f[n-1]) where f is a list of n unitless values defining the acceleration factor for each velocity. When a velocity value does not lie exactly on those points, a linear interpolation of the two closest points will be calculated. When a velocity value is greater than the max point defined, a linear extrapolation of the two biggest points will be calculated. Signed-off-by: Yinon Burgansky <51504-Yinon@users.noreply.gitlab.freedesktop.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-01-13tools: fflush the output in debug-events after each set of eventsPeter Hutterer1-0/+3
Fixes e.g. the case where debug-events is used to get the initial device list but no more. Since we never flush, the content is stuck in the buffers and gets lost. Easy way to reproduce: `libinput debug-events | cat`, then ctrl+c and see nothing show up (before this patch, anyway). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-12-12tools/record: fix quirk error messageJosé Expósito1-3/+7
When libinput-record fails to parse the quirks, it suggest to use the --verbose flag to get more details. However, libinput-record does not support the --verbose flag. Replace the error message and add a link to the documentation instead. Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2022-12-08tools: add a --hid toggle to libinput-list-kernel-devicesPeter Hutterer2-2/+56
Lists all SUBSYSTEM=hid devices, including the respective hidraw and evdev nodes. Note that this takes a shortcut in the udev handling: in theory we *should* compare the hidraw/evdev parent device with our hid device. In practice, checking if the devpath starts with the same substring is good enough. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-12-08tools: add a libinput list-kernel-devices toolPeter Hutterer3-0/+97
Same as libinput list-devices, but lists the available event nodes. This effectively does the same as libinput record without arguments but it's more obvious in what it is supposed to do and thus easier to point to. Also, it uses pyudev instead of libevdev so it does not need to run as root to discover devices. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-11-28quirks: allow overriding of AttrEventCode and AttrInputPropPeter Hutterer1-14/+17
This switches the quirk from AttrEventCodeEnable/Disable to just AttrEventCode with a +/- prefix for each entry. This switches the quirk from AttrInputPropEnable/Disable to just AttrInputProp with a +/- prefix for each entry. Previously, both event codes and input props would only apply the last-matching section entry for a device. Furthermore, an earlier Disable entry would take precedence over a later Enable entry. For example, a set of sections with these lines *should* enable left, right and middle: [first] AttrEventCodeEnable=BTN_LEFT;BTN_RIGHT;BTN_MIDDLE [second] AttrEventCodeDisable=BTN_RIGHT [third] AttrEventCodeEnable=BTN_LEFT;BTN_RIGHT; Alas: the first line was effectively ignored (quirks only returned the last-matching one, i.e. the one from "third"). And due to implementation details in evdev.c, the Disable attribute was processed after Enable, i.e. the device was enabled for left + right and then disabled for right. As a result, the device only had BTN_LEFT enabled. Fix this by changing the attribute to carry both enable/disable information and merging the commands together. Internally, all quirks matching a device are simply ref'd into an array in the struct quirks. The applied value is simply the last entry in the array corresponding to our quirk. For AttrEventCode and AttrInputProp instead do this: - switch them to a tuple with the code as first entry and a boolean enable/disable as second entry - if the struct quirk already has an entry for either, append the more recent one to the existing entry (instead of creating a new entry in the array). This way we have all entries that match and in-order of precedence - i.e. we can process them left-to-right to end up with the right state. Fixes: https://gitlab.freedesktop.org/libinput/libinput/-/issues/821 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-11-25tools: fix a tab after space whitespace issuePeter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-11-25Remove duplicate empty lines in our sourcePeter Hutterer4-5/+0
We only touch src and tools, imported headers from include are not ours to change. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-11-25Remove a few empty lines with nothing but a lonely tabPeter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-11-25Remove trailing whitespaces in the treePeter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-11-23sparse: make some variables staticJosé Expósito1-1/+1
When compiling with Sparse enabled: $ CC=cgcc meson builddir Fix warnings about variables that should be made static. Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2022-10-10debug-gui: avoid locking pointer twiceJosé Expósito1-1/+2
On Sway, and probably other Wayland compositors based on wlroots, the window_lock_pointer() was called twice. Avoid errors when window_lock_pointer() is invoked multiple times. Fix https://gitlab.freedesktop.org/libinput/libinput/-/issues/808 Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2022-10-10tools: hide debug-gui help when building with -Ddebug-gui=falseJosé Expósito1-0/+2
Some distributions, like Fedora, compile libinput with the debug-gui option set to false. Running "libinput debug-gui" indicates that the program is not installed; however, the help message suggests that the command is available. Hide debug-gui from the help message when it is not included. Fix https://gitlab.freedesktop.org/libinput/libinput/-/issues/480 Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2022-08-08tools: add missing dwtp option settingPeter Hutterer1-0/+3
Fixes 1f1ddbc6dff0cf0451e3c9ac923f9821278560aa Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-06-11meson.build: check gtk targets before buildingPeter Hutterer1-11/+11
We have two different dependencies on Wayland: GTK support and the wayland-protocols we use directly. If we have GTK support but wayland-protocols is not installed at meson configure time, our build fails. To avoid having multiple ifdefs in the code, let's define two new ones: HAVE_GTK_WAYLAND and HAVE_GTK_X11, both set if GTK supports that particular target (from pkgconfig) and we have the other support libraries we need. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-05-09test: install libinput-test-utils as part of install-testsPeter Hutterer1-0/+3
This tests a bunch of internal utility functions that may work differently depending on compiler flags, etc. Let's make that test available so it can be verified on an installed system. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-05-09tools: add a libinput test tool as entry point for our test suitesPeter Hutterer3-0/+112
We already install libinput-test-suite if the meson option install-tests is set, see commit be7045cdc70d8c026d981997852cc706dab3d5b8 test: make the test suite runner available as installed binary To make other tests easily available and more discoverable, add a new tool "libinput test" with the matching man page. This will also help us to enforce some of the namespacing a bit better. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-05-06tools/analyze-recording: improve the repeated-events line printingPeter Hutterer1-3/+6
When redirecting to a file, we don't want lines like this: .. +2 ... +5 ... +9 Let's not print anything until we have collected all those lines and then print the final result, we don't need a live update here. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-05-06tools/analyze-recording: add --print-state to always print valuesPeter Hutterer1-2/+13
Helpful in comparing values that update frequently - without this the last printed value may be way off the page when some other value comes in that it needs to be compared to. Values not seen yet default to zero - we can't query those from a recording but it'll be good enough this way. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-05-06tools/record: fix indentation for libinput eventsPeter Hutterer1-1/+4
Commit 0cdf459643bfa6264bd2d1af8f7749529ebffee1 tools/record: get rid of indent push/pop, replace with fixed indents Introduced some magic to detect if there's a '-' at the start of the format string to fix the identation. This only works if the format string is constant though, leading to an indentation error when record is run with --with-libinput. Fixes 0cdf459643bfa6264bd2d1af8f7749529ebffee1 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-05-04tools: don't print a carriage return if we're not on a ttyPeter Hutterer1-1/+4
Otherwise redirecting the output to a file leaves us with ugly ^M Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-05-04tools: allow limiting the axes in libinput analyse recordingPeter Hutterer1-5/+32
Use --ignore ABS_X,ABS_Y or --only ABS_X,ABS_Y to ignore or limit to only a specific axis set. Especially for tablet devices with their multitudes of axes this makes analysing a particular set easier. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-04-07tools/record: fix the indentation of the system: sectionPeter Hutterer1-1/+1
Fixes 0cdf459643bfa6264bd2d1af8f7749529ebffee1 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-03-09util: auto-declare the element variable in ARRAY_FOR_EACHPeter Hutterer3-8/+0
All cases we have in our code base have an otherwise unused variable to loop through the array. Let's auto-declare this as part of the loop. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-03-08touchpad: new option dwtp (disable-while-trackpointing)pudiva chip líquida6-0/+37
Add option to control whether the touchpad should be disabled while the trackpoint is in use. Fix #731 Signed-off-by: pudiva chip líquida <pudiva@skylittlesystem.org>
2022-01-15tools: remove hardcoded value for boolean quirksJosé Expósito1-1/+3
When a boolean quirk was displayed its real value was ignored and instead a hardcoded value of 1 was always used. Get the quirk real value and display it. Fix #725 Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-11-18Use bit(foo) instead of (1 << foo)Peter Hutterer1-2/+3
Translates to the same thing, but the bit() helper is nicer and less likely to be typoed. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-08-31High-resolution scroll wheel supportPeter Hutterer2-57/+63
Starting with kernel v5.0 two new axes are available for high-resolution wheel scrolling: REL_WHEEL_HI_RES and REL_HWHEEL_HI_RES. Both axes send data in fractions of 120 where each multiple of 120 amounts to one logical scroll event. Fractions of 120 indicate a wheel movement less than one detent. This commit adds a new API for scroll events. Three new event types that encode the axis source in the event type name and a new API to get a normalized-to-120 value that also used by Windows and the kernel (each multiple of 120 represents a logical scroll click). This addresses a main shortcoming with the existing API - it was unreliable to calculate the click angle based on the axis value+discrete events and thus any caller using the axis value alone would be left with some ambiguity. With the v120 API it's now possible to (usually) calculate the click angle, but more importantly it provides the simplest hw-independent way of scrolling by a click or a fraction of a click. A new event type is required, the only way to integrate the v120 value otherwise was to start sending events with a discrete value of 0. This would break existing xf86-input-libinput (divide by zero, fixed in 0.28.2) and weston (general confusion). mutter, kwin are unaffected. With the new API, the old POINTER_AXIS event are deprecated - callers should use the new API where available and discard any POINTER_AXIS events. Notable: REL_WHEEL/REL_HWHEEL are emulated by the kernel but there's no guarantee that they'll come every accumulated 120 values, e.g. Logitech mice often send events that don't add up to 120 per detent. We use the kernel's wheel click emulation instead of doing our own. libinput guarantees high-resolution events even on pre-5.0 kernels. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-08-03debug-gui: pointer locking on X11José Expósito1-0/+65
Signed-off-by: José Expósito <jose.exposito89@gmail.com>