summaryrefslogtreecommitdiff
path: root/tools/libinput-debug-events.c
Commit message (Collapse)AuthorAgeFilesLines
* tools: fix a few scan-build dead store warningsPeter Hutterer2023-04-201-3/+3
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: fflush the output in debug-events after each set of eventsPeter Hutterer2023-01-131-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>
* Remove duplicate empty lines in our sourcePeter Hutterer2022-11-251-1/+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>
* touchpad: new option dwtp (disable-while-trackpointing)pudiva chip líquida2022-03-081-0/+8
| | | | | | | | | 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>
* High-resolution scroll wheel supportPeter Hutterer2021-08-311-25/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* libinput: add hold gesture public API and tool supportJosé Expósito2021-06-091-1/+14
| | | | | | | | Add hold gestures to the public API and the private functions to notify them. Also add hold gestures to debug-events and debug-gui. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: José Expósito <jose.exposito89@gmail.com>
* tools/debug-events: rework touch event printingPeter Hutterer2020-10-211-28/+20
| | | | | | | | | Previously, touch up events did not contain the slot number which makes the logs ambiguous (e.g. see the one in #532). Fix that, and since doing so would require extra conditions anyway get rid of the current with/without coords function and just handle it all inside one function instead. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: print the libinput_dispatch() counter for debugging messagesPeter Hutterer2020-10-061-1/+1
| | | | | | | | The messages with priority DEBUG refer to the various internal state machines updating, so it's useful to know when they did so. Let's count up every time we trigger libinput_dispatch() so we know how the messages group together. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: only call libinput_dispatch() once per pollPeter Hutterer2020-10-061-1/+0
| | | | | | | This is a closer approximation of all callers anyway, and it makes it easier to debug which events are handled per libinput_dispatch() call. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* remove extra paramenter in libinput-debug-eventsweizhixiang2020-09-071-2/+2
| | | | Signed-off-by: weizhixiang <1138871845@qq.com>
* tools: constify the optarg handling of seatsPeter Hutterer2020-02-241-9/+5
| | | | | | | | This shuts up scan-build complaining about memory leaks in libinput debug-events (needs the right combination of --device option and eventually triggering usage()) and saves us a bunch of unnecessary allocations. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: align the tool type names on proximity nicelyPeter Hutterer2020-01-301-1/+1
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* pad: add LIBINPUT_EVENT_TABLET_PAD_KEY for pad keysPeter Hutterer2019-12-041-0/+32
| | | | | | | | | | | | | | | | | | | | The Wacom Cintiq 24HD and later tablets send specific key events for hardware/soft buttons. KEY_PROG1..KEY_PROG3 on earlier tablets, KEY_CONTROLPANEL, KEY_ONSCREEN_DISPLAY, and KEY_BUTTONCONFIG on later tablets. We ignore KEY_PROG1-3 because starting with kernel 5.4 older tablets will too use the better-named #defines. These differ from pad buttons as the key code in itself carries semantic information, so we should pass them on as-is instead of mapping them to meaningless 0-indexed buttons like we do on the other buttons. So let's add a new event, LIBINPUT_EVENT_TABLET_PAD_KEY and the associated functions to handle that case. Pad keys have a fixed hw-defined semantic meaning and are thus not part of a tablet mode group. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: debug-events: don't overrun the device array with too many argumentsPeter Hutterer2019-12-041-1/+5
| | | | | | | | | | | | | Only the --device option was checked for argument count, not the rest so it's easy to overrun the array by specifying too many devices. Except: this was a theoretical bug only, more than 64 arguments trigger an assertion in the argv processing in tools/shared.c anyway. Let's drop the debug-events limit to 60 devices so we can at least have a test for this. Found by coverity Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: print the libinput version in debug-eventsPeter Hutterer2019-11-271-0/+4
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: make debug-events accept multiple device nodesPeter Hutterer2019-11-261-7/+30
| | | | | | | For interaction between devices it's necessary to look at more than one device at a time. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: debug-events: expand timestamp prints to full millisPeter Hutterer2019-11-181-1/+1
| | | | | | Tens of millis is not quite enough in some cases. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: debug-events: offset timestamps by the first normal eventPeter Hutterer2019-11-181-7/+11
| | | | | | | | Start counting the timestamps from the first time we get something off the actual fd. This makes it easier to match up timestamps with the output from libinput record. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* libinput-debug-events.c: remove unused includesKonstantin Kharlamov2019-09-131-4/+1
| | | | Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
* tablet: add a the Totem tool type to the tablet interfacePeter Hutterer2019-06-071-0/+16
| | | | | | | | | | | | | | | | This is the public API only, not the internal bits, so nothing will work just yet. This interface addition is for the Dell Canvas Totem tool, so let's go with the same name because options like "Rotary" are too ambiguous. The totem is a knob that can be placed on the surface, it provides us with location and rotation data. The touch major/minor fields are filled in by the current totem, but they're always the same size. The totem exports BTN_0 as well, so let's add that to the debug-events output. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: display the discrete axis steps tooPeter Hutterer2019-03-041-2/+7
| | | | | | | | | | | Draw a second smaller scroll bar that moves with every discrete step. For that to work, we have to accumulate the value from the normal scroll events until we get the first discrete one, then move up. The value per discrete event changes depending on the click wheel angle, so we can't just use discrete on its own if we want the two scroll bars aligned. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: don't apply config options on device removedPeter Hutterer2018-12-191-1/+3
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: let debug-events take a device pathPeter Hutterer2018-11-071-3/+9
| | | | | | | This is the most common use-case other than "all from udev", so let's just parse a device path correctly without requiring --device. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: make the tools exit with exit code 2 on usage issuesPeter Hutterer2018-11-071-6/+6
| | | | | | This makes it easier to test for usage issues Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: debug-events: install the signal handler before any libinput operationsPeter Hutterer2018-11-071-11/+11
| | | | | | | | On a CI container, we will time out trying to find the udev device for our device node. This takes 2s, a SIGINT during this time should be treated the same as one during the mainloop. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: align the rotation value with 3 digitsPeter Hutterer2018-09-271-1/+1
| | | | | | This is a 0-360 ranged value, so let's print it aligned. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: add a missing space in the proximity in axis listingPeter Hutterer2018-09-271-1/+1
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: debug-events - print axes on tablet tip eventsPeter Hutterer2018-09-051-63/+65
| | | | | | | Bit of a weird diff, print_tablet_axes() was moved up and a single call to print_tablet_axes() was added in the tablet tip event handler. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: debug-*: show unaccelerated deltas for pointer eventsPeter Hutterer2018-08-081-1/+3
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: fix grab argument passing for libinput debug-eventsPeter Hutterer2018-06-141-1/+1
| | | | | | | | | | | | | | | The &grab pointer we used to pass as userdata was the address of the function argument which goes out of scope at the end of the function. This works fine for devices immediately opened but when a device connects later, the address may have been re-used since and it's content is undefined. If not NULL, we end up grabbing the device. Instead pass the grab option in which is guaranteed to live until the end of main. https://gitlab.freedesktop.org/libinput/libinput/issues/26 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: print the number of touches for touch devicesPeter Hutterer2018-05-021-0/+4
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: libinput-debug-events stop variable needs volatilePeter Seiderer2018-03-151-1/+1
| | | | | | | | | The stop variable set in the signal handler needs volatile (and use the defined sig_atomic_t instead of unsigned int). Signed-off-by: Peter Seiderer <ps.report@gmx.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Include stdarg.h where variadic functions are usedGreg V2017-12-011-0/+1
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: add an extra linebreak before closingPeter Hutterer2017-11-091-0/+2
| | | | | | Just puts the ^C from the Ctrl+C on a separate line to make it easier to spot Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: Handle LIBINPUT_SWITCH_TABLET_MODEStefan Brüns2017-11-061-0/+3
| | | | | Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: remove a leftover debug printf statementPeter Hutterer2017-09-061-1/+0
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: split the configuration option parsing outPeter Hutterer2017-06-261-15/+86
| | | | | | | | | | | | | | | We had one shared parsing function for all config options so tools parse options that don't actually make sense (e.g. --quiet or --show-keycodes for libinput-list-devices). This patch splits the actual libinput device configuration out and reshuffles everything to make use of that. One large patch, because splitting this up is more confusing than dumping it all. This means the actual option parsing is partially duplicated between debug-gui and debug-events but hey, not everything in life is perfect. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: make the libinput tool usage staticPeter Hutterer2017-06-021-1/+0
| | | | | | This now makes the header obsolete too Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: tidy up the usage() for the tools a bitPeter Hutterer2017-06-021-1/+1
| | | | | | | Now that the debug-gui is a user-visible tool, make sure the usage reflects the right command name. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: switch the libinput tool to be an exec-ing toolPeter Hutterer2017-06-021-12/+2
| | | | | | | | | | | | | | | | | | Chaining args together inside a single binary would be nice, but it gets nasty quickly (as I found out adding 3, 4 extra commands). Switch over to using a git-style exec-ing command where libinput merely changes argv[0] and then executes whatever it assembled. And those binaries can hide in libexec so they don't clutter up the global namespace. This also makes it a lot easier to write man pages, adopt the same style as git uses. Compatibilty wrapper scripts are provided for libinput-list-devices and libinput-debug events. These warn the user about the changed command, then exec the new one. Expect these wrappers to be removed at some point in the future. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: hook libinput-debug-events into the libinput toolPeter Hutterer2017-05-181-2/+13
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: rename a source file to match the future common file name paradigmPeter Hutterer2017-05-181-0/+923
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>