Commit graph

22 commits

Author SHA1 Message Date
Peter Hutterer
60d4f1b2ae Change to the (always intended) MIT license
Due to what must've been a copy/paste error many years ago, the license text
for libevdev wasn't actually the MIT license. Let's rectify this, it was
always MIT intended anyway.

To make this more obvious and reduce the chance of copy/paste mistakes, use
the SPDX license identifier in the various source files. The two installed
public header files have the full license text.

All contributors with copyrightable contributions have ACKed the license
change to MIT, either in the MR directly [1] or privately in reply to an
email.

[1] https://gitlab.freedesktop.org/libevdev/libevdev/-/merge_requests/69

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Alexander Dahl <ada@thorsis.com>
Acked-by: Andreas Pokorny <andreas.pokorny@canonical.com>
Acked-by: Armin K <krejzi@email.com>
Acked-by: Benjamin Tissoires <btissoir@redhat.com>
Acked-by: David Herrmann <dh.herrmann@gmail.com>
Acked-by: Deepa Dinamani <deepa.kernel@gmail.com>
Acked-by: Emmanuele Bassi <ebassi@gnome.org>
Acked-by: Gaetan Nadon <memsize@videotron.ca>
Acked-by: George Thomas <georgefsthomas@gmail.com>
Acked-by: Michael Forney <mforney@mforney.org>
Acked-by: Nayan Deshmukh <nayan26deshmukh@gmail.com>
Acked-by: Niclas Zeising <zeising@daemonic.se>
Acked-by: Owen W. Taylor <otaylor@fishsoup.net>
Acked-by: Peter Seiderer <ps.report@gmx.net>
Acked-by: Ran Benita <ran234@gmail.com>
Acked-by: Rosen Penev <rosenp@gmail.com>
Acked-by: Scott Jann <sjann@knight-rider.org>
Acked-by: Thilo Schulz <thilo@tjps.eu>
Acked-by: polyphemus <rolfmorel@gmail.com>
2021-01-25 13:46:55 +10:00
Niclas Zeising
6ea230bc72 tools: Remove signalfd.h include again
Remove the includsion of sys/signalfd.h again, it hasn't been needed
since cca90938 and was accidentally re-added, probably as a mismerge,
in a40e014e.

Signed-off-by: Niclas Zeising <zeising@daemonic.se>
2020-09-19 12:13:12 +02:00
Rosen Penev
fb6a84a52a
[clang-tidy] do not use else after return
Found with readability-else-after-return

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-08-27 00:42:20 -07:00
Rosen Penev
a40e014eca
libevdev: sort includes alphabetically
Found with clang-tidy's llvm-include-order

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-08-27 00:29:54 -07:00
Niclas Zeising
1bf2b41d3f tools: use basename(argv[0]) for program name
Use baename(argv[0]) to get the program name (for usage), instead of
using program_invocation_short_name, which only exists on Linux, not
FreeBSD.

Signed-off-by: Niclas Zeising <zeising@daemonic.se>
2020-08-14 17:50:56 +02:00
Niclas Zeising
cca9093887 tools: Remove signalfd() use
Remove signalfd() use from the mouse-dpi-tool and touchpad-edge-detector
tools, in favor of using plain old signals.
FreeBSD does not have signalfd() without pulling in external libraries,
and with this change these tools can be compiled on FreeBSD.
Instead of providing two implementations, one using signalfd() and one
using signal(), just use the signal() implementation everywhere as it is
more portable.

Signed-off-by: Niclas Zeising <zeising@daemonic.se>
2020-08-14 17:50:56 +02:00
Peter Hutterer
223909ed0b tools: fix the include path for local includes
Make sure we use the local include files, and correct the path accordingly.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-17 17:42:32 +10:00
Peter Hutterer
0a66de813e tools: drop use of HAVE_CONFIG_H
There's no case where we don't have a config.h

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-14 12:03:23 +10:00
Deepa Dinamani
3c6766c862 Update struct input_event
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>
2018-04-12 15:23:22 +10:00
Peter Hutterer
1ec01b1310 tools: print an error if we don't have any matching events in the dpi tool
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>
2017-01-17 14:50:29 +10:00
Peter Hutterer
a155a977b7 tools: move udev printf into the print_summary() helper
No functional changes

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-01-17 14:42:13 +10:00
Peter Hutterer
61f0a0f9ad tools: print the mean frequency together with the max frequency
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>
2016-09-21 16:57:29 +10:00
Peter Hutterer
55c43b19cf tools: rename frequency to max_frequency in the dpi tool
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-09-19 10:55:51 +10:00
Peter Hutterer
94385480ff tools: use uint64_t, not doubles for the µs parameters
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-09-16 07:26:42 +10:00
Peter Hutterer
e1d87fa6df tools: widen frequency resolution to µs in the DPI tool
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>
2015-05-21 11:52:40 +10:00
Peter Hutterer
d26973216c tools: fix help string for manual DPI calculation
https://bugs.freedesktop.org/show_bug.cgi?id=90143

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-04-23 10:36:55 +10:00
Peter Hutterer
f4cc76d96f tools: note that the mouse frequency measured is the highest frequency
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>
2015-01-07 13:39:55 +10:00
Peter Hutterer
59c824ebc0 tools: fix clang compiler warning
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>
2015-01-07 08:33:10 +10:00
Peter Hutterer
e897f6f821 tools: print the formula to calculate resolutions
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>
2014-12-12 08:37:24 +10:00
Peter Hutterer
9923b06e71 tools: zero-pad PID/VID in the dpi tool
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-12-05 14:17:27 +10:00
Peter Hutterer
6ce23c6d79 tools: print the hwdb match line from the dpi tool
Let's make this as easy as possible

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-12-02 09:39:14 +10:00
Peter Hutterer
bb406fe411 tools: add a tool to estimate the resolution of a mouse
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>
2014-11-21 09:42:12 +10:00