summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-03-08fix(evemu-play): exit on EOFHEADmasterpseudoc1-1/+4
This will also make commands like following work, and gracefully exit after play the recording once. `echo | evemu-play recording`
2024-02-29CI: add new workflow rulesPeter Hutterer1-0/+5
Required for pipelines to run after some infrastructure changes, see https://gitlab.freedesktop.org/freedesktop/freedesktop/-/issues/438
2023-10-09tools: fall back to alphasort when versionsort isn't availableHarry Cutts1-1/+9
versionsort keeps the device list in proper numerical order (e.g. so that event10 is sorted after event9, not event1), but is only available when compiling with the GNU C library. Signed-off-by: Harry Cutts <hcutts@google.com>
2023-10-09tools: use basename(argv[0]) instead of program_invocation_short_nameHarry Cutts3-14/+18
program_invocation_short_name is a GNU-specific extension of the C library, and therefore isn't available when compiling with other implementations. Signed-off-by: Harry Cutts <hcutts@google.com>
2020-09-30test: replace the hardcoded EV_MAX array with the libevdev onePeter Hutterer2-17/+12
Kernel 5.8 changed the value of SW_MAX but libevdev has a built-in check for out-of-range bits (it silently discards those). So where evemu is built against a new kernel but a libevdev that hasn't been updated yet, our test expects bit up to the new SW_MAX while libevdev discards all bits above the old SW_MAX. Fix this by making sure the test and uses the same value of the respective type max as evemu itself does. Fixes #3 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-09-30include: sync with the 5.8 kernel headersPeter Hutterer1-4/+107
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-08-31Fix links in the README that referred to evtestHarry Cutts1-3/+3
2020-03-24Add a minimal gitlab CIPeter Hutterer1-0/+42
Run a distcheck after a build and hope for the best. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-03-24update to libevdev's autogen.shPeter Hutterer1-7/+13
Runs configure on its own which will reduce the CI messiness a bit Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-03-24src/evemu.c: fix build with kernels < 4.16Fabrice Fontaine1-0/+8
Commit 30973c0b fixed the build with kernels >= 4.16 but as a side effect, build with kernels < 4.16 is now failing on: evemu.c:892:18: error: ‘struct input_event’ has no member named ‘input_event_usec’ tv.tv_usec = ev->input_event_usec; ^~ Fix this error by defining input_event_sec and input_event_usec if needed Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2020-03-23src/evemu.c: fix build with kernels >= 4.16Fabrice Fontaine1-6/+1
Commit 30973c0b forgot to update all occurences of input_event, this will result in the following build failure with kernel >= 4.16: evemu.c: In function 'write_event_desc': evemu.c:753:23: error: 'const struct input_event' has no member named 'time'; did you mean 'type'? time = millis(&ev->time); ^~~~ type Fixes: - http://autobuild.buildroot.org/results/487dd5056ec0a977d55b23417d5db2664dcc91fa Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2019-03-22test: link the evemu-create test with -no-installPeter Hutterer1-1/+1
This way it's linked against evemu and we can override this for testing (LD_PRELOAD, etc.). And it has the benefit of gdb still working. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-31evemu: Update struct input_eventDeepa Dinamani1-12/+23
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> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-31include: add the kernel's input headersPeter Hutterer4-0/+1583
So we're not dependent on kernel version we build on.
2018-06-06Change all URLs to gitlab.fdoPeter Hutterer1-2/+2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-04-09Init the evtime with 0 rather than calling memset on itPeter Hutterer1-2/+1
The compiler was probably smart enough to figure that out, but still. No functional changes. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-11-22tools: s/evtest/evemu/ in the evemu-describe man pagePeter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-10-19Fix warning when using autorestart without output fileMartin Kepplinger1-1/+1
The warning in case of a missing output file when using --autorestart is talking about --autoresume which doesn't exist. This is confusing so fix this. Signed-off-by: Martin Kepplinger <martink@posteo.de> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-10-12Include limits.h for PATH_MAX.Peter Seiderer1-0/+1
Fixes the following compile failure when building with musl: find_event_devices.c: In function ‘find_event_devices’: find_event_devices.c:60:14: error: ‘PATH_MAX’ undeclared (first use in this function) char fname[PATH_MAX]; ^~~~~~~~ Signed-off-by: Peter Seiderer <ps.report@gmx.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-25Evemu v2.7.0v2.7.0Benjamin Tissoires1-2/+2
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-09-25python: Add missing binding for evemu_get_abs_current_valueBenjamin Berg1-0/+11
Add a binding to get the current value of an EV_ABS value. https://bugs.freedesktop.org/show_bug.cgi?id=102615 Signed-off-by: Benjamin Berg <bberg@redhat.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-09-19test: test-evemu-create.c: declare check_evemu_read() staticMartin Kepplinger1-1/+1
check_evemu_read() is only use locally in this module. It should be static. Signed-off-by: Martin Kepplinger <martink@posteo.de> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-17evemu-record.c: fix memory access in error pathMartin Kepplinger1-1/+1
In case the output file could not have been opened, it is accessed anyways although it's zero, resulting in a segmentation fault. So let's free it in the out-path only if allocated before. Signed-off-by: Martin Kepplinger <martink@posteo.de> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-17evemu-record.c: Fix evemu-describe writing to output fileMartin Kepplinger1-1/+1
We had incremented the argv pointer once too often here. What was read is some buffer outside of our scope, not the next argument after the device. Right before, "prefix" is already set up to point to the user's output file path. Let's use it. I guess people work around and always use redirection of stdout in order to get a file instead. This makes writing directly work. Signed-off-by: Martin Kepplinger <martink@posteo.de> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-17evemu-record.c: Add missing newline to error messageMartin Kepplinger1-1/+1
In case the output file cannot be opened, the message is the only thing that gets printed and really should contain a newline in order to have a sane commandline prompt, for example. Signed-off-by: Martin Kepplinger <martink@posteo.de> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-14evemu-describe.txt: fix typoMartin Kepplinger1-1/+1
It's supposed to say "current" instead of "curent". Signed-off-by: Martin Kepplinger <martink@posteo.de> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-05tools: evemu-record: set global variables staticMartin Kepplinger1-2/+2
output and autorestart are only used in evemu-record. Declaring them static makes things a little more readable. Signed-off-by: Martin Kepplinger <martink@posteo.de> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-02Let printf handle the EV_SYN time delta's signPeter Hutterer1-1/+1
Related to https://bugs.freedesktop.org/show_bug.cgi?id=101150 For a negatice time delta (can happen on autoresume, see the bug) we end up printing +-25ms. This patch doesn't fix the negative time delta but at least switches it to just print -25ms. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-06-02Fix compiler warning about truncated outputPeter Hutterer1-1/+1
It's a false positive because we only ever print /dev/input/eventXX but let's shut it up anyway. find_event_devices.c: In function ‘find_event_devices’: find_event_devices.c:65:9: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 53 [-Wformat-truncation=] "%s/%s", DEV_INPUT_EVENT, namelist[i]->d_name); ^~ find_event_devices.c:64:3: note: ‘snprintf’ output between 12 and 267 bytes into a destination of size 64 snprintf(fname, sizeof(fname), ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "%s/%s", DEV_INPUT_EVENT, namelist[i]->d_name); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-05-03README: fix link to wiki pagePeter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-12-14Evemu v2.6.0v2.6.0Benjamin Tissoires1-2/+2
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-11-10python: encode/decode C strings for Python 3Peter Hutterer1-6/+23
Python3 uses unicode and byte arrays need to be explicitly encoded/decoded in Python3 to avoid the ctypes TypeError when converting between python strings and C strings. https://bugs.freedesktop.org/show_bug.cgi?id=97458 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-11-10python: fix ctypes NULL-pointer checksPeter Hutterer1-6/+5
NULL-pointers are None, not 0. This only worked because we kept falling through until some other later condition triggered and happened to return the correct value at all times (usually because the type/code ended up as -1) Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-11-09python: use "is None" instead of "== None"Peter Hutterer1-6/+6
A fairly subtle difference, but "is None" is preferred. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-11-08python: automatically rewind the fd at the end of the event sequencePeter Hutterer3-0/+15
Allows running through the event sequence more than once without any extra handling. In modern recordings the description and the event file is in the same file and there is no extra fd handling for the events. So simple code to check events would look like this: d = evemu.Device("/path/to/file", create=False) for e in d.events(): check_for_something() for e in d.events(): check_for_something_else() Simply rewinding the fd is sufficient here to avoid the caller having to keep a copy of the events. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Martin <consume.noise@gmail.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-11-08python/test: don't use 'e' for an fd and the eventPeter Hutterer1-2/+2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Martin <consume.noise@gmail.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-11-08Include the various MAX values in the outputPeter Hutterer2-9/+9
https://bugs.freedesktop.org/show_bug.cgi?id=97956 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Martin <consume.noise@gmail.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-11-08Fail when reading an EV_foo index greater than EV_MAXPeter Hutterer1-0/+5
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Martin <consume.noise@gmail.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-10-25Print the device size where applicablePeter Hutterer1-0/+22
Needed often enough, might as well print it Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Martin <consume.noise@gmail.com>
2016-10-25Upgrade a warning to a fatal errorPeter Hutterer1-1/+1
It's already a fatal error, print it that way. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Martin <consume.noise@gmail.com>
2016-10-25test: rename a duplicate function namePeter Hutterer1-1/+1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Martin <consume.noise@gmail.com>
2016-10-25Mark the error() function as format printfPeter Hutterer1-0/+3
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Martin <consume.noise@gmail.com>
2016-10-25Align the resolution with the other valuesPeter Hutterer1-6/+7
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Martin <consume.noise@gmail.com>
2016-09-16Evemu v2.5.0v2.5.0Benjamin Tissoires1-2/+2
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-07-01tools: make evemu-play create devices and re-run recordingsPeter Hutterer2-19/+122
$ evemu-play touchpad.evemu will create the device from the recording and prompt the user to hit enter before replaying the sequence. Re-playing the same sequence multiple times just requires hitting enter again. https://bugs.freedesktop.org/show_bug.cgi?id=96688 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-07-01tools: Merge evemu-device and evemu-play into a single filePeter Hutterer3-134/+102
No real code changes, this just merges the two files in preparation for a multi-mode evemu-play. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-05-12Ignore carriage return in device namesPeter Hutterer1-1/+1
bugzilla attachments sometimes have CRLF as end of line, make sure we ignore that for the device name. Otherwise our device name contains the \r, affecting printfs. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-05-12tools: fix a couple of indentation/coding style issuesPeter Hutterer1-7/+8
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-04-04Evemu v2.4.0v2.4.0Benjamin Tissoires1-2/+2
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2016-03-01evemu-record: if we have no events, delete the autorestarted filePeter Hutterer1-1/+8
Keep any file that has events in it and keep the last file (i.e. when evemu-record was cancelled). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>