Commit graph

806 commits

Author SHA1 Message Date
Peter Hutterer
69403a63ed libevdev 1.12.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-11-09 09:52:06 +10:00
Peter Hutterer
d03f9b6616 tools: add a helper tool to list all currently known codes
A non-installed tool to make it easy to check if newly added codes are
indeed supported correctly.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-11-09 09:46:16 +10:00
Peter Hutterer
fdba5a41dd include: sync event codes with kernel 5.15
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-11-09 08:54:21 +10:00
José Expósito
889fc01c81 doc: fix initialization and setup error
Remove an unnecessary and unmatched curly bracket from the demo code.

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-09-04 13:30:17 +02:00
José Expósito
8a4f45df5b doc: fix uinput device creation warnings
The example code for creating uinput devices produces the following
warnings:

warning: unused variable ‘ev’ [-Wunused-variable]
   | struct input_event ev[2];
   |                    ^~
warning: unused variable ‘new_fd’ [-Wunused-variable]
   | int fd, new_fd, uifd;
   |         ^~~~~~
warning: ‘err’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   |     return err;
   |            ^~~

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-09-04 13:21:42 +02:00
Ulrich Ölmann
9b918d316a doc: fix typos
Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
2021-08-17 18:33:58 +02:00
Ulrich Ölmann
5fc81553f5 doc: fix uinput example code
Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
2021-08-17 15:09:26 +02:00
Peter Hutterer
a6970e1cec gitlab CI: update to latest ci-templates
We can ditch the custom localhost usages and instead use the vmctl and
ssh-config aliases.

Signed-off-by:	Peter Hutterer <peter.hutterer@who-t.net>
2021-07-26 10:23:39 +10:00
Simeon Schaub
662c84d80e
build: properly link against rt
This is especially relevant for cross-compilation, since libevdev uses
`clock_gettime`.
This came up in https://github.com/JuliaPackaging/Yggdrasil/pull/3201.

Signed-off-by: Simeon Schaub <simeondavidschaub99@gmail.com>
2021-06-21 02:56:52 +02:00
Peter Hutterer
bb1cd0dd57 gitlab CI: bump to Fedora 34 and Ubuntu 21.04
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-05-19 10:37:21 +10:00
Peter Hutterer
a53c6d1154 gitlab CI: make the tarball distro selection automatic
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-05-19 10:36:58 +10:00
Peter Hutterer
4e5babd7a1 gitlab CI: make the qemu selection automatic
Generate the snippet for whichever is the last version in the list for the
want_qemu tag.

And move the want_qemu tag up so it's more obvious in the config file.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-05-19 10:36:53 +10:00
Richard Purdie
8d70f44989 make-event-names: Fix determinism issue
The order of dict values is not deterministic in python leading to differing 
header file generation which results in differing build output for the same
configuration. Sort to remove this inconsistency and make the output 
reproducible.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Reviewed-by: Filipe Laíns <lains@archlinux.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-02-22 07:06:46 +10:00
Peter Hutterer
8855f1ac59 libevdev 1.11.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-02-01 15:51:10 +10:00
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
Peter Hutterer
7eae5e322c libevdev 1.10.1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-01-11 13:07:47 +10:00
Peter Hutterer
70881516f2 doc: fix conflicting documentation for libevdev_get_event_value()
Yes, the value we return is from the currently active slot, but there are a
few niche cases where the active slot changes from what the client may think
it is. So let's call it undefined like the other half of the documentation
already does.

Fixes #20

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-01-08 09:58:16 +10:00
Peter Hutterer
510bde8f47 gitlab CI: use Fedora 33 and Ubuntu 20.10
This requires latest CI templates for the mkosi changes. Since the start_vm.sh
script is now gone, switch to using vmctl instead.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-01-04 11:49:42 +10:00
Peter Hutterer
7f53bcfab3 gitlab CI: make the custom build reference automated
We still require Fedora for the various jobs with custom autotools/meson
configurations. But we might as well make it dependent on the config file
entries only than hardcoding it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-01-04 10:59:25 +10:00
Peter Hutterer
896d087a0e include: sync event codes with kernel 5.10
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-12-14 00:17:15 +00:00
Shuo Wang
74dc7ff245 CODING_STYLE.md: fix a typo
Signed-off-by: Shuo Wang <wangshuo47@huawei.com>
2020-11-03 14:42:25 +08:00
Peter Hutterer
e6f3141eb6 libevdev 1.10.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-10-26 09:07:01 +10:00
Peter Hutterer
a37d76b49b README: drop an obsolete paragraph
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-10-26 09:06:09 +10:00
Peter Hutterer
869fda7810 libevdev 1.10rc2 2020-10-20 09:34:05 +10:00
Scott Jann
4226c7801b Add libevdev_disable_property
On some devices, a kernel input property has been set in error and we need the
ability to disable that property.

Signed-off-by: Scott Jann <sjann@knight-rider.org>
2020-10-19 14:47:07 +10:00
Nayan Deshmukh
8e94375bc6 Add link to Rust bindings
Signed-off-by: Nayan Deshmukh <nayan26deshmukh@gmail.com>
2020-10-10 03:58:22 +00:00
Peter Hutterer
df677d954c libevdev 1.10rc1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-10-06 10:19:50 +10:00
Peter Hutterer
f6c0a048c5 tools: add a man page for the touchpad-edge-detector tool
Requires some .gitignore pattern removal too and an autotools fix to actually
dist the man pages.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-10-06 09:56:33 +10:00
Peter Hutterer
da2eea1dcb meson.build: install the libevdev-tweak-device man page
This got lost in meson conversion

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-10-06 09:44:45 +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
Peter Hutterer
44b5c9bd9f include: sync event codes with kernel 5.8
And fix the script to sync the headers up so it syncs event codes for both bsd
and linux, but only syncs input.h for linux.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-09-11 12:13:13 +10:00
Peter Hutterer
b40675c701 doc: fix doxyen complaints after fd6c9b8ca0
Fixes fd6c9b8ca0

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-09-11 12:13:04 +10:00
Peter Hutterer
cb5d56ab80 gitlab ci: run the qemu jobs on F32
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-09-11 11:04:27 +10:00
Peter Hutterer
ed71864c4c gitlab CI: update to use F32
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-09-11 10:38:54 +10: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
Rosen Penev
cd8bde522f libevdev: remove pointless return in void function
Found with clang-tidy's readability-redundant-control-flow

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-08-27 07:15:28 +00:00
Rosen Penev
fd6c9b8ca0 libevdev: fix inconsistent declarations
Found with clang-tidy's readability-inconsistent-declaration-parameter-name

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-08-27 07:15:28 +00:00
Niclas Zeising
1f54f82f70 Document FreeBSD quirks
Document FreeBSD quirks related to syspath.

Signed-off-by: Niclas Zeising <zeising@daemonic.se>
2020-08-14 17:50:56 +02:00
Niclas Zeising
4194023122 tests: Add FreeBSD specific tests
Add two FreeBSD specific tests:
test_uinput_check_devnode_bsd checks that libevdev_uinput_get_devnode()
returns something sensible.  This is modelled on the Linux test
test_uinput_check_syspath_name, but uses devnode instead of syspath, since
reeBSD doesn't have sysfs.
test_uinput_check_syspath_bsd checks that libevdev_uinput_get_syspath()
always returns NULL.

Signed-off-by: Niclas Zeising <zeising@daemonic.se>
2020-08-14 17:50:56 +02:00
Niclas Zeising
0af8c4054d tests: Disable attach debugger on FreeBSD
Disable attaching a debugger on FreeBSD, since FreeBSD lacks support for
PTRACE_ATTACH.

Signed-off-by: Niclas Zeising <zeising@daemonic.se>
2020-08-14 17:50:56 +02:00
Niclas Zeising
8026722f86 tests: disable force feedback events on FreeBSD
FreeBSD does not support force feedack events.  Disable the test for
this event when running on FreeBSD.

Signed-off-by: Niclas Zeising <zeising@daemonic.se>
2020-08-14 17:50:56 +02:00
Niclas Zeising
800946a673 tests: Use CLOCK_MONOTONIC_FAST on FreeBSD
FreeBSD does not have CLOCK_MONOTONIC_RAW, instead use
CLOCK_MONOTONIC_FAST.  This test checks that libevdev_set_clock_id()
fails when called with CLOCK_MONOTONIC_[RAW,FAST].

Signed-off-by: Niclas Zeising <zeising@daemonic.se>
2020-08-14 17:50:56 +02:00
Niclas Zeising
83e446225d uinput: Implement FreeBSD fetch_syspath_and_devnode()
Implement a FreeBSD version of fetch_syspath_and_devnode().
FreeBSD does not have sysfs, so instead fetch the device node directly
as as this matches with what is returned by the UI_GET_SYSNAME ioctl().
Since there is no sysfs, libevdev_uinput.syspath will always be set to NULL.

If the ioctl fail, return -1 from fetch_syspath_and_devnode(), since
there is no other way to figure out the device node path.

Signed-off-by: Niclas Zeising <zeising@daemonic.se>
2020-08-14 17:50:56 +02:00
Niclas Zeising
153d8d0a5a uinput: Move SYS_INPUT_DIR to where it is used
Move the definition of SYS_INPUT_DIR to where it is used, instead of at
the top of the file, to make it easier to find.
Undefine it at the end of usage to avoid accidental uses.

Signed-off-by: Niclas Zeising <zeising@daemonic.se>
2020-08-14 17:50:56 +02: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
Niclas Zeising
7ce82709aa Add FreeBSD compatible input.h and uinput.h
Add FreeBSD compatible input.h and uinput.h files.
This is done by moving the linux files to include/linux/linux, adding
the freebsd versions in include/linux/freebsd, and then changing
include/linux/[u]input.h to pull in the right one depending on which OS
we are compiling on.
Make sure that the build infrastructure in meson.build and
autoconf.ac/Makefile.am uses the correct files when building and as
dependency for targets, and ensure that make-event-names.py get the
correct files as arguments.

A similar change has been done in libinput in
61f3e3854458c556a01fb05d7abb22733fd2b7c1

Signed-off-by: Niclas Zeising <zeising@daemonic.se>
2020-08-14 17:50:56 +02:00
Niclas Zeising
db01b2d606 Don't hardcode /bin/bash
Don't hardcode /bin/bash, use /usr/bin/env bash instead, since not all
platforms install bash as /bin/bash.
FreeBSD, as an example, installs bash in /usr/local/bin/bash by default.

Signed-off-by: Niclas Zeising <zeising@daemonic.se>
2020-08-13 13:11:33 +02:00
Peter Hutterer
bcb79eed39 libevdev 1.9.1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-07-16 13:39:45 +10:00