Commit graph

815 commits

Author SHA1 Message Date
Peter Hutterer
c9781f00f3 uinput: use named initializers for the event struct
With the 64 bit timestamps, the struct layout changes into a flatter
version, so let's use the input_event_(u)sec helpers to transparently
handle this.

Fixes #25

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-07-11 15:32:59 +10:00
Peter Hutterer
0c7e1d2f67 Fix a few whitespace/coding style issues
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-07-11 15:31:45 +10:00
Peter Hutterer
2d49be8303 Fix a compiler warning
[1/16] Compiling C object libevdev.so.2.3.0.p/libevdev_libevdev.c.o
../libevdev/libevdev.c:665:40: warning: argument 2 of type ‘struct slot_change_state[dev->num_slots]’ declared as a variable length array [-Wvla-parameter]
  665 |               struct slot_change_state changes_out[dev->num_slots])
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
../libevdev/libevdev.c:47:52: note: previously declared as a pointer ‘struct slot_change_state *’
   47 |                          struct slot_change_state *changes_out);
      |                          ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-07-11 15:31:45 +10:00
Peter Hutterer
c2eaaa171e meson: up the timeout to 10s per test
Fixes #26

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-07-11 15:28:23 +10:00
Peter Hutterer
de2daf8d36 meson.build: install the mouse-dpi-tool man page
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-03-25 14:37:28 +10:00
Peter Hutterer
8ced382eb8 libevdev 1.12.1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-03-25 14:32:48 +10:00
Peter Hutterer
f3c3b0a233 include: sync key codes with kernel 5.17
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-03-22 12:34:08 +10:00
Peter Hutterer
7c43e86944 gitlab CI: update to current distribution versions, drop Centos
No big point building for Centos 7 anywmore, and Centos 8 is now Centos
Stream only which needs fixing in the CI templates first.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-02-02 00:29:35 +00:00
Stephen Kitt
066d9caf55
Add a manpage for mouse-dpi-tool
Signed-off-by: Stephen Kitt <steve@sk2.org>
2021-11-15 08:58:11 +01:00
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