1libinput-record(1) General Commands Manual libinput-record(1)
2
3
4
6 libinput-record - record kernel events
7
9 libinput record [options] [/dev/input/event0]
10
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
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
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
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
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 udev:
153 properties:
154 - ID_INPUT_MOUSE=1
155 - ID_INPUT=1
156 quirks:
157 - ModelAppleTouchpad=1
158 - AttrSizeHint=32x32
159 events:
160 - evdev:
161 - [ 0, 0, 3, 57, 1420] # EV_ABS / ABS_MT_TRACKING_ID 1420
162 - [ 0, 0, 3, 53, 1218] # EV_ABS / ABS_MT_POSITION_X 1218
163 - [ 0, 0, 3, 54, 1922] # EV_ABS / ABS_MT_POSITION_Y 1922
164 - [ 0, 0, 3, 52, 0] # EV_ABS / ABS_MT_ORIENTATION 0
165 - [ 0, 0, 3, 58, 47] # EV_ABS / ABS_MT_PRESSURE 47
166 - [ 0, 0, 1, 330, 1] # EV_KEY / BTN_TOUCH 1
167 - [ 0, 0, 1, 325, 1] # EV_KEY / BTN_TOOL_FINGER 1
168 - [ 0, 0, 3, 0, 1218] # EV_ABS / ABS_X 1218
169 - [ 0, 0, 3, 1, 1922] # EV_ABS / ABS_Y 1922
170 - [ 0, 0, 3, 24, 47] # EV_ABS / ABS_PRESSURE 47
171 - [ 0, 0, 0, 0, 0] # ------------ SYN_REPORT (0) ------- +0ms
172 - evdev:
173 - [ 0, 11879, 3, 53, 1330] # EV_ABS / ABS_MT_POSITION_X 1330
174 - [ 0, 11879, 3, 54, 1928] # EV_ABS / ABS_MT_POSITION_Y 1928
175 - [ 0, 11879, 3, 58, 46] # EV_ABS / ABS_MT_PRESSURE 46
176 - [ 0, 11879, 3, 0, 1330] # EV_ABS / ABS_X 1330
177 - [ 0, 11879, 3, 1, 1928] # EV_ABS / ABS_Y 1928
178 - [ 0, 11879, 3, 24, 46] # EV_ABS / ABS_PRESSURE 46
179 - [ 0, 11879, 0, 0, 0] # ------------ SYN_REPORT (0) ------- +0ms
180 # second device (if any)
181 - node: /dev/input/event9
182 evdev: ...
183
184 Top-level keys are listed below, see the respective subsection for
185 details on each key.
186
187 version: int
188 The file format version. This version is only increased for
189 backwards-incompatible changes. A parser must ignore unknown
190 keys to be forwards-compatible.
191
192 ndevices: int
193 The number of device recordings in this file. Always 1 unless
194 recorded with --multiple
195
196 libinput: {...}
197 A dictionary with libinput-specific information.
198
199 system: {...}
200 A dictionary with system information.
201
202 devices: {...}
203 A list of devices containing the description and and events of
204 each device.
205
206
207 libinput
208 version: string
209 libinput version
210
211
212 system
213 Information about the system
214
215 kernel: string
216 Kernel version, see uname(1)
217
218 dmi: string
219 DMI modalias, see /sys/class/dmi/id/modalias
220
221
222 devices
223 Information about and events from the recorded device nodes
224
225 node: string
226 the device node recorded
227
228 evdev A dictionary with the evdev device information.
229
230 udev A dictionary with the udev device information.
231
232 events A list of dictionaries with the recorded events
233
234 evdev
235 name: string
236 The device name
237
238 id: [bustype, vendor, product, version]
239 The data from the struct input_id, bustype, vendor, product,
240 version.
241
242 codes: {type: [a, b, c ], ...}
243 All evdev types and codes as nested dictionary. The evdev type
244 is the key, the codes are a list.
245
246 absinfo: {code: [min, max, fuzz, flat, resolution], ...}
247 An array of arrays with 6 decimal elements each, denoting the
248 contents of a struct input_absinfo. The first element is the
249 code (e.g. ABS_X) in decimal format.
250
251 properties: [0, 1, ...]
252 Array with all INPUT_PROP_FOO constants. May be an empty array.
253
254 udev
255 properties: list of strings
256 A list of udev properties in the key=value format. This is not
257 the complete list of properties assigned to the device but a
258 subset that is relevant to libinput. These properties may
259 include properties set on a parent device.
260
261 quirks: list of strings
262 A list of device quirks the key=value format.
263
264
265 events
266 A list of the recorded events. The list contains dictionaries Informa‐
267 tion about the events. The content is a list of dictionaries, with the
268 string identifying the type of event sequence.
269
270 { evdev: [ {"data": [sec, usec, type, code, value]}, ...] }
271 Each input_event dictionary contains the contents of a struct
272 input_event in decimal format. The last item in the list is
273 always the SYN_REPORT of this event frame. The next event frame
274 starts a new evdev dictionary entry in the parent events list.
275
276
278 This tool records events from the kernel and is independent of libin‐
279 put. In other words, updating or otherwise changing libinput will not
280 alter the output from this tool. libinput itself does not need to be in
281 use to record events.
282
284 Part of the libinput(1) suite
285
286
287
288 libinput-record(1)