1libinput-record(1)          General Commands Manual         libinput-record(1)
2
3
4

NAME

6       libinput-record - record kernel events
7

SYNOPSIS

9       libinput record [options] [/dev/input/event0]
10

DESCRIPTION

12       The libinput record tool records kernel events from a device and prints
13       them in a format that can later be replayed with the libinput replay(1)
14       tool.  This tool needs to run as root to read from the device.
15
16       The  output of this tool is YAML, see FILE FORMAT for more details.  By
17       default it prints to stdout unless the -o option is given.
18
19       The events recorded are independent of  libinput  itself,  updating  or
20       removing libinput will not change the event stream.
21

OPTIONS

23       If a device node is given, this tool opens that device node. Otherwise,
24       a list of devices is presented and the user can select  the  device  to
25       record.  If unsure, run without any arguments.
26
27       --help  Print help
28
29       --all   Record  all  /dev/input/event* devices available on the system.
30               This option should be used in exceptional cases only, the  out‐
31               put file is almost always too noisy and replaying the recording
32               may not be  possible.  Use  --multiple  instead.   This  option
33               requires  that a --output-file is specified and may not be used
34               together with --multiple.
35
36       --autorestart=s
37               Terminate the current recording after s seconds of device inac‐
38               tivity. This option requires that a --output-file is specified.
39               The output filename is used as prefix, suffixed with  the  date
40               and time of the recording. The timeout must be greater than 0.
41
42       -o filename.yml
43       --output-file=filename.yml
44               Specifies  the output file to use. If --autorestart or --multi‐
45               ple is given, the filename is used as prefix only.
46
47       --multiple
48               Record multiple devices at once, see section RECORDING MULTIPLE
49               DEVICES  This option requires that a --output-file is specified
50               and that all devices to be recorded are given on  the  command‐
51               line.
52
53       --show-keycodes
54               Show  keycodes  as-is in the recording. By default, common keys
55               are obfuscated and printed as KEY_A to avoid information leaks.
56
57       --with-libinput
58               Record libinput events alongside device events.   THIS  FEATURE
59               IS  EXPERIMENTAL.   See  section  RECORDING LIBINPUT EVENTS for
60               more details.
61
62

RECORDING MULTIPLE DEVICES

64       Sometimes it is necessary to record the events  from  multiple  devices
65       simultaneously, e.g.  when an interaction between a touchpad and a key‐
66       board causes a bug. The --multiple option records multiple devices with
67       an  identical  time offset, allowing for correct replay of the interac‐
68       tion.
69
70       The --multiple option requires that an output filename is given.   This
71       filename is used as prefix, with the event node number appended.
72
73       All  devices  to  be  recorded  must be provided on the commandline, an
74       example invocation is:
75
76       libinput    record    --multiple    -o    tap-bug     /dev/input/event3
77       /dev/input/event7
78
79       Note  that  when  recording  multiple devices, only the first device is
80       printed immediately, all other devices and their events are printed  on
81       exit.
82
83

RECORDING LIBINPUT EVENTS

85       When  the  --with-libinput switch is provided, libinput-record initial‐
86       izes a libinput context for the devices  being  recorded.  Events  from
87       these contexts are printed alongside the evdev events.  THIS FEATURE IS
88       EXPERIMENTAL.
89
90       The primary purpose of this feature is debugging and event analysis, no
91       caller may rely on any specific format of the events.
92
93       Note  that  while libinput and libinput-record see the same events from
94       the device nodes, no guarantee can be given about the correct order  of
95       events.  libinput  events  may come in earlier or later than the events
96       from the device nodes and for some  devices,  libinput  may  internally
97       alter the event stream before processing.
98
99       Note  that  the  libinput  context  created by libinput-record does not
100       affect the running desktop session and does not  (can  not!)  copy  any
101       configuration options from that session.
102
103

FILE FORMAT

105       The  output  file format is in YAML and intended to be both human-read‐
106       able and machine-parseable. Below is a short  example  YAML  file,  all
107       keys are detailed further below.
108
109       Any  parsers must ignore keys not specified in the file format descrip‐
110       tion.  The version number field is only used for backwards-incompatible
111       changes.
112
113       version: 1
114       ndevices: 2
115       libinput:
116         version: 1.10.0
117       system:
118         kernel: "4.13.9-200.fc26.x86_64"
119         dmi: "dmi:bvnLENOVO:bvrGJET72WW(2.22):bd02/21/2014:svnLENOVO:..."
120       devices:
121         - node: /dev/input/event9
122           evdev:
123             # Name: Synaptics TM2668-002
124             # ID: bus 0x1d vendor 0x6cb product 00 version 00
125             # Size in mm: 97x68
126             # Supported Events:
127             # Event type 0 (EV_SYN)
128
129             #.. abbreviated for man page ...
130
131             #
132             name: Synaptics TM2668-002
133             id: [29, 1739, 0, 0]
134             codes:
135               0: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] # EV_SYN
136               1: [272, 325, 328, 330, 333, 334, 335] # EV_KEY
137               3: [0, 1, 24, 47, 48, 49, 52, 53, 54, 55, 57, 58] # EV_ABS
138             absinfo:
139               0: [0, 4089, 0, 0, 42]
140               1: [0, 2811, 0, 0, 41]
141               24: [0, 255, 0, 0, 0]
142               47: [0, 4, 0, 0, 0]
143               48: [0, 15, 0, 0, 0]
144               49: [0, 15, 0, 0, 0]
145               52: [0, 1, 0, 0, 0]
146               53: [0, 4089, 0, 0, 42]
147               54: [0, 2811, 0, 0, 41]
148               55: [0, 2, 0, 0, 0]
149               57: [0, 65535, 0, 0, 0]
150               58: [0, 255, 0, 0, 0]
151             properties: [0, 2, 4]
152           hid: [12, 23, 34, 45, ...]
153           udev:
154             properties:
155             - ID_INPUT_MOUSE=1
156             - ID_INPUT=1
157           quirks:
158             - ModelAppleTouchpad=1
159             - AttrSizeHint=32x32
160           events:
161             - evdev:
162               - [  0,      0,   3,  57,  1420] # EV_ABS / ABS_MT_TRACKING_ID   1420
163               - [  0,      0,   3,  53,  1218] # EV_ABS / ABS_MT_POSITION_X    1218
164               - [  0,      0,   3,  54,  1922] # EV_ABS / ABS_MT_POSITION_Y    1922
165               - [  0,      0,   3,  52,     0] # EV_ABS / ABS_MT_ORIENTATION      0
166               - [  0,      0,   3,  58,    47] # EV_ABS / ABS_MT_PRESSURE        47
167               - [  0,      0,   1, 330,     1] # EV_KEY / BTN_TOUCH               1
168               - [  0,      0,   1, 325,     1] # EV_KEY / BTN_TOOL_FINGER         1
169               - [  0,      0,   3,   0,  1218] # EV_ABS / ABS_X                1218
170               - [  0,      0,   3,   1,  1922] # EV_ABS / ABS_Y                1922
171               - [  0,      0,   3,  24,    47] # EV_ABS / ABS_PRESSURE           47
172               - [  0,      0,   0,   0,     0] # ------------ SYN_REPORT (0) ------- +0ms
173             - evdev:
174               - [  0,  11879,   3,  53,  1330] # EV_ABS / ABS_MT_POSITION_X    1330
175               - [  0,  11879,   3,  54,  1928] # EV_ABS / ABS_MT_POSITION_Y    1928
176               - [  0,  11879,   3,  58,    46] # EV_ABS / ABS_MT_PRESSURE        46
177               - [  0,  11879,   3,   0,  1330] # EV_ABS / ABS_X                1330
178               - [  0,  11879,   3,   1,  1928] # EV_ABS / ABS_Y                1928
179               - [  0,  11879,   3,  24,    46] # EV_ABS / ABS_PRESSURE           46
180               - [  0,  11879,   0,   0,     0] # ------------ SYN_REPORT (0) ------- +0ms
181         # second device (if any)
182         - node: /dev/input/event9
183           evdev: ...
184
185       Top-level  keys  are  listed  below,  see the respective subsection for
186       details on each key.
187
188       version: int
189               The file format version. This version  is  only  increased  for
190               backwards-incompatible  changes.  A  parser must ignore unknown
191               keys to be forwards-compatible.
192
193       ndevices: int
194               The number of device recordings in this file. Always  1  unless
195               recorded with --multiple
196
197       libinput: {...}
198               A dictionary with libinput-specific information.
199
200       system: {...}
201               A dictionary with system information.
202
203       devices: {...}
204               A  list of devices containing the description and and events of
205               each device.
206
207
208   libinput
209       version: string
210               libinput version
211
212
213   system
214       Information about the system
215
216       kernel: string
217               Kernel version, see uname(1)
218
219       dmi: string
220               DMI modalias, see /sys/class/dmi/id/modalias
221
222
223   devices
224       Information about and events from the recorded device nodes
225
226       node: string
227               the device node recorded
228
229       evdev   A dictionary with the evdev device information.
230
231       hid     A list of  integers  representing  the  HID  report  descriptor
232               bytes.
233
234       udev    A dictionary with the udev device information.
235
236       events  A list of dictionaries with the recorded events
237
238   evdev
239       name: string
240               The device name
241
242       id: [bustype, vendor, product, version]
243               The  data  from  the struct input_id, bustype, vendor, product,
244               version.
245
246       codes: {type: [a, b, c ], ...}
247               All evdev types and codes as nested dictionary. The evdev  type
248               is the key, the codes are a list.
249
250       absinfo: {code: [min, max, fuzz, flat, resolution], ...}
251               An  array  of arrays with 6 decimal elements each, denoting the
252               contents of a struct input_absinfo. The first  element  is  the
253               code (e.g. ABS_X) in decimal format.
254
255       properties: [0, 1, ...]
256               Array with all INPUT_PROP_FOO constants. May be an empty array.
257
258   udev
259       properties: list of strings
260               A  list of udev properties in the key=value format. This is not
261               the complete list of properties assigned to the  device  but  a
262               subset  that  is  relevant  to  libinput.  These properties may
263               include properties set on a parent device.
264
265       quirks: list of strings
266               A list of device quirks the key=value format.
267
268
269   events
270       A list of the recorded events. The list contains dictionaries  Informa‐
271       tion  about the events. The content is a list of dictionaries, with the
272       string identifying the type of event sequence.
273
274       { evdev: [ {"data": [sec, usec, type, code, value]}, ...] }
275               Each input_event dictionary contains the contents of  a  struct
276               input_event  in  decimal  format.  The last item in the list is
277               always the SYN_REPORT of this event frame. The next event frame
278               starts a new evdev dictionary entry in the parent events list.
279
280

NOTES

282       This  tool  records events from the kernel and is independent of libin‐
283       put. In other words, updating or otherwise changing libinput  will  not
284       alter the output from this tool. libinput itself does not need to be in
285       use to record events.
286

LIBINPUT

288       Part of the libinput(1) suite
289
290
291
292                                                            libinput-record(1)
Impressum