summaryrefslogtreecommitdiff
path: root/tools
Commit message (Collapse)AuthorAgeFilesLines
* tools: fix the include path for local includesPeter Hutterer2020-02-174-4/+6
| | | | | | Make sure we use the local include files, and correct the path accordingly. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: drop explicit GNU_SOURCE definePeter Hutterer2020-02-141-1/+0
| | | | | | It's defined globally through AC_USE_SYSTEM_EXTENSIONS Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* config.h is a local include pathPeter Hutterer2020-02-142-2/+2
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: drop use of HAVE_CONFIG_HPeter Hutterer2020-02-142-4/+0
| | | | | | There's no case where we don't have a config.h Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Update struct input_eventDeepa Dinamani2018-04-122-11/+5
| | | | | | | | | | The struct input_event is not y2038 safe. Update the struct according to the kernel patch: https://lkml.org/lkml/2018/1/6/324 Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: add a script to sync the kernel header filesPeter Hutterer2017-07-031-0/+30
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: print an error if we don't have any matching events in the dpi toolPeter Hutterer2017-01-171-2/+9
| | | | | | | | Beats crashing by dereferencing a null-pointer (when we access m->frequencies[idx]) Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
* tools: move udev printf into the print_summary() helperPeter Hutterer2017-01-171-29/+29
| | | | | | | No functional changes Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
* tools: print the mean frequency together with the max frequencyPeter Hutterer2016-09-211-4/+39
| | | | | | | | | | | | | | | | | | And if they're 30% out, print a warning. On the ThinkPad X1 Wireless Touch Mouse (when connected via bluetooth) we get a bunch of events at the start of the movement, all less than 1ms apart. Best guess is that the device goes to low-power, then notices the movement and buffers the event until the BT connection is back up. Then it sends all events at once. Usually they're less than 1ms apart, but at one recording showed a 37ms delay before we go back to the normal 70ms (~15Hz) the mouse has otherwise. This is unpredictable enough that we can't just work around it so instead print a warning to the user so they can go investigate. https://bugs.freedesktop.org/show_bug.cgi?id=97812 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
* tools: rename frequency to max_frequency in the dpi toolPeter Hutterer2016-09-191-6/+7
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: use uint64_t, not doubles for the µs parametersPeter Hutterer2016-09-161-1/+1
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: fix kernel-announced width/heightPeter Hutterer2016-09-151-1/+3
| | | | | | | | Side-effect of 240ba34ebd483 was that "touchpad size as listed by the kernel" was now dependent on the values we got. This one is a static one based on the axis info. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: fix the touchpad resolution calculationPeter Hutterer2016-08-261-2/+2
| | | | | | | Previous ones used the absinfo from the kernel but since we never updated that from within the tool, the output was always the same. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: require a minimum size for touchpadsPeter Hutterer2016-08-011-0/+8
| | | | | | This mostly aims to catch users trying to specify the size in inches. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: change touchpad-edge-detector to require physical sizePeter Hutterer2016-08-011-17/+32
| | | | | | | | | | Almost no-one does the calculations for me to update the udev rules (and some rules were submitted with the <x resolution> placeholders left in). Require the user to specify the physical size so we just copy/paste the actual udev rule. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
* tools: allow numeric axis values in tweak-devicePeter Hutterer2016-04-221-4/+37
| | | | | | | | Not all axes a device may have are assigned a semantic name. https://bugs.freedesktop.org/show_bug.cgi?id=95029 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: fix tweak-device option parsingPeter Hutterer2016-04-221-7/+14
| | | | | | https://bugs.freedesktop.org/show_bug.cgi?id=92880 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: shut up coverity about a potential close(-1)Peter Hutterer2016-01-041-1/+2
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: fix coverty "may be used uninitialized" warningsPeter Hutterer2016-01-041-4/+5
| | | | | | | | | | | | | tools/libevdev-tweak-device.c:390: uninit_use_in_call: Using uninitialized value "changes" when calling "parse_options_abs". tools/libevdev-tweak-device.c:376: warning: 'led' may be used uninitialized in this function tools/libevdev-tweak-device.c:375: warning: 'axis' may be used uninitialized in this function Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: fix touchpad-edge-detector udev rule outputPeter Hutterer2015-11-101-2/+2
| | | | | | off-by-one error on the ABS_ axes printed. ABS_X/Y are 0 and 1. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: print out evdev override udev rule from touchpad edge detectorPeter Hutterer2015-08-241-1/+81
| | | | | | | | | | | | | | | | | | | | | | | | | We're starting to collect overrides for custom devices, making this easier for users and saves us time. Once we measured everything, print out a guesstimated udev rule and instructions on how to calculate the resolution. Extra output now is: Touchpad size as listed by the kernel: 132x111mm Calculate resolution as: x axis: 6076/<width in mm> y axis: 5021/<height in mm> Suggested udev rule: # <Laptop model description goes here> evdev:input:b0005v05ACp030E* EVDEV_ABS_01=-2694:2862:<x resolution> EVDEV_ABS_02=-20:121:<y resolution> EVDEV_ABS_35=-2694:2862:<x resolution> EVDEV_ABS_36=-20:121:<y resolution> The ABS_MT_ axes are only printed if the device have them, if the device isn't bluetooth/usb we print the dmi modalias instead. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools - tweak-device: add a --resolution commandPeter Hutterer2015-07-012-2/+105
| | | | | | | | So far, 100% of the usages for tweak-tool was to set the x/y resolution of a device. Make --resolution a shortcut for this. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
* tools - tweak-device: revamp to reduce use of globalsPeter Hutterer2015-07-011-61/+152
| | | | | | | | | Make the code base a bit more modular so it's easier to add new commands. Main change here is: options are parsed twice now, first time for the mode (abs/led) and the device path, then again for the mode-specific options. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
* tools - tweak-device: fix wrong error message if the LED doesn't existPeter Hutterer2015-06-291-1/+1
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools - tweak-device: close the fd on exitPeter Hutterer2015-06-291-1/+3
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: complain about devices that don't have abs x/y axes in the edge detectorPeter Hutterer2015-06-101-0/+8
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: widen frequency resolution to µs in the DPI toolPeter Hutterer2015-05-211-10/+10
| | | | | | | | | | The Microsoft Arc Touch Mouse claims 8000fps which is higher than we can measure in the current milliseconds resolution. http://www.cnet.com/products/microsoft-arc-touch-mouse-black-series/specs/ https://bugs.freedesktop.org/show_bug.cgi?id=90540 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: fix help string for manual DPI calculationPeter Hutterer2015-04-231-1/+1
| | | | | | https://bugs.freedesktop.org/show_bug.cgi?id=90143 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* cosmetic: fix a couple of duplicate/missing empty linesPeter Hutterer2015-03-042-2/+0
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: add a tool to change kernel devicesPeter Hutterer2015-02-044-1/+321
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: note that the mouse frequency measured is the highest frequencyPeter Hutterer2015-01-071-2/+4
| | | | | | | | Some devices scale the frequency based on the input and will provide recordings with different frequencies each time. Recommend to measure multiple times since we can only know what the highest frequency is. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: fix clang compiler warningPeter Hutterer2015-01-071-1/+1
| | | | | | | | | | mouse-dpi-tool.c:213:39: warning: missing field 'frequency' initializer [-Wmissing-field-initializers] struct measurements measurements = {0}; Annoying, but a low-cost fix. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: print the formula to calculate resolutionsPeter Hutterer2014-12-121-1/+4
| | | | | | | And encourage users to move at least 25cm, makes it a lot easier to pick the resolution. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: zero-pad PID/VID in the dpi toolPeter Hutterer2014-12-051-1/+1
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: print the hwdb match line from the dpi toolPeter Hutterer2014-12-021-0/+28
| | | | | | Let's make this as easy as possible Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: add a tool to estimate the resolution of a mousePeter Hutterer2014-11-213-1/+241
| | | | | | | | | | | | | | | | | Relative devices don't provide a physical resolution to the host. For things like pointer acceleration, the physical amount of movement is better as baseline than the movement in device units. Alas, many devices don't come with any information at all, so the users have to guess. Help that guesswork by providing a tool that does the calculations for them. This tool measures the device units covered, then prints the frequency and an lookup table for various resolutions (in dpi) to match to the physical movement of the device. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
* tools: pass -rc to strerror, not rcPeter Hutterer2014-08-221-1/+1
| | | | | | | | rc is a negative errno Found by Coverity. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: Fix compiler warningEmmanuele Bassi2014-02-261-1/+1
| | | | | Signed-off-by: Emmanuele Bassi <ebassi@gnome.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Fix the include directives when building in tools/Emmanuele Bassi2014-02-261-1/+1
| | | | | | | | We need to add top_srcdir to fix the build when srcdir != builddir. Signed-off-by: Emmanuele Bassi <ebassi@gnome.org> Reviewed-by: David Herrmann <dh.herrmann@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: add a tool to print the actual range provided by a touchpadPeter Hutterer2014-02-253-0/+201
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Review/update .gitignore filesGaetan Nadon2013-11-191-0/+1
| | | | | | | | | | | | | | | | Merge potentially useful patterns taken from other projects. Some application specific patterns were move to their respective directories. The only noticeable change is that *.patch is ignore to prevent accidental checkin of patches. The pattern "test-driver" could not be found and was removed. The test directory had not been updated since the move of all test cases in a single binary. Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Add a copy of linux/input.hPeter Hutterer2013-10-231-1/+1
| | | | | | | This avoids a number of otherwise required ifdefs when building on older kernels Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
* Mark three deprecated functions as suchPeter Hutterer2013-10-041-1/+1
| | | | | | | These are deprecated, but were missing the deprecated attribute. And fix up the tests that were still using those deprecated calls. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: make to function calls staticPeter Hutterer2013-09-171-2/+4
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* tools: Honor GCC_CFLAGSColin Walters2013-09-171-1/+1
| | | | | | | So we get compiler warnings from tools/ too. Signed-off-by: Colin Walters <walters@verbum.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Name-space the read flags betterPeter Hutterer2013-09-111-2/+2
| | | | | | | | Rename from LIBEVDEV_READ_foo to LIBEVDEV_READ_FLAG_foo to differentiate better from LIBEVDEV_READ_STATUS_foo. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
* Enumerate libevdev_next_event() return codesPeter Hutterer2013-09-111-5/+5
| | | | | | | | | | | | | | | | Improved readability in callers, changing magic numbers 0 and 1 to rc = libevdev_next_event(); if (rc == LIBEVDEV_READ_STATUS_SUCCESS) do_something(); else if (rc == LIBEVDEV_READ_STATUS_SYNC) do_something_else() No ABI changes, the enum values are the previously documented values, this is just a readability improvement. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
* Revamp the API once againPeter Hutterer2013-09-101-5/+5
| | | | | | | | | | | | | | | | | Another look at the current API showed some inconsistencies, rectified in this commit: libevdev_kernel_*: modify the underlying kernel device libevdev_event_type_*: something with an event type libevdev_event_code_*: something with an event code libevdev_event_*: struct input_event-related functions (i.e. not device-related) libevdev_property_*: something with a property libevdev_*: anything applying to a device Hopefully that's the last API change. Current symbols deprecated and aliased. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
* Rename ID getters to have a consistent naming schemePeter Hutterer2013-08-011-3/+3
| | | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
* Rename a few getters for consistencyPeter Hutterer2013-08-011-1/+1
| | | | | | | | | | | Deprecated: * libevdev_get_abs_min, libevdev_get_abs_max * libevdev_get_input_prop_name Will be removed in one or two versions. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>