For historical (but not very good) reasons, libinput record printed events
from the first device to the output file (or stdout) and buffered everything
else. On ctrl+c, the other devices' descriptions and the buffered events were
appended to the output file.
This makes the printing code rather complex. Simplify it by giving each device
a separate FILE* - the first device points to the real output file, the others
to a tempfile. On Ctrl+C we just append those tempfiles to the real output
file one-by-one and done.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
No functional changes since we can get this easily from the list itself, but
in the future the first device will be used more extensively.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Using list_insert() here means the last device specified on the commandline is
the one that ends up in the file first - not very obvious...
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Our file format is static enough that we don't need to use push/pop, we know
exactly which line is going where. So let's replace it with a static
indent instead.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This is prep work to be more consistent with the use of tempfile later for
individual devices.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
With a new helper function strv_from_argv we can re-use the device opening
loop for all the use-cases we have.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Add a second grey v-shaped (upside down triangle) pointer that moves around
with the unaccelerated deltas. This makes it easier to visualize how the
unaccelerated pointer moves around, the snake helps for some use-cases but not
all of them.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This makes it easier to visualize changes in various axes or key states that
should not be there, doubly so for long recordings.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Just like the other python-based tools it's just a basename copy, so let's be
consistent here and have all tools perform that way.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Using poll means more difficult fd management, epoll (together with am
modified version of the libinput_sources) makes this a lot easier by simply
using dispatch.
This means we are no longer reliant on a specific file descriptor order in the
poll array.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
If we have no events in any of the recorded devices, state that this is the
case and make Enter simply quit instead of a pointless while loop.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
When running with --with-libinput, the first event is the DEVICE_ADDED event
for our device. Those events do not have a timestamp.
We have to find the first event in the recording with a timestamp instead.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Let's leave this up to the compiler, the usual side-effect of inline (compiler
doesn't complain about an unused static function) doesn't apply here.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
For long-running recordings it's useful to know what the actual time was when
a particular event occured. A user can simply check the clock or system logs
for the time and thus know which portion of the recording to focus on.
Let's print the time into the recording, every 5 seconds (aligned at the 5,
10, 15s marks) or, if no events occured in the last 5 seconds, before the next
event. This granularity should be enough to identify the interesting parts of
a recording.
Let's print this as a comment until we have a use-case that requires parsing
this data.
The timer is the simplest approach, it just repeats at a fixed 5 seconds
interval from startup. There may be time drift, we can fix that if needed.
Fixes#560
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
No functional changes, this makes the code slightly more readable, especially
once we start adding more "special" fds.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
No functional changes, this makes the code slightly more readable, especially
once we start adding more "special" fds.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Minor tidying up the code, set the default values for all fds in the same loop
instead of having it split to wherever the fd is created.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
tools/libinput-measure-fuzz.py:212:15:
F523 '...'.format(...) has unused arguments at position(s): 1
But the E741 is better turned off in general:
tools/libinput-measure-fuzz.py:319:29: E741 ambiguous variable name 'l'
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Previously, touch up events did not contain the slot number which makes the
logs ambiguous (e.g. see the one in #532). Fix that, and since doing so would
require extra conditions anyway get rid of the current with/without coords
function and just handle it all inside one function instead.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Alternate between two randomly-chosen colors for each batch of debug messages
to make it easier to visually group the two.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
The messages with priority DEBUG refer to the various internal state machines
updating, so it's useful to know when they did so. Let's count up every time
we trigger libinput_dispatch() so we know how the messages group together.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This is a closer approximation of all callers anyway, and it makes it easier
to debug which events are handled per libinput_dispatch() call.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>