EVTEST(1)

๐ŸŒธ NAME ๐ŸŒธ

evtest โ€” your lil input device event monitor and query tool, bestie ๐Ÿ’…


โœจ SYNOPSIS โœจ

evtest [--grab] /dev/input/eventX

evtest --query /dev/input/eventX <type> <value>

๐ŸŽ€ DESCRIPTION ๐ŸŽ€

okay so there are like two whole moods this program can be in and they're very different, bestie.

The first one โ€” the one up top, "capture mode" โ€” makes evtest show you all the tea about the input device you named, including literally every event the device supports. And then? Then it just sits there and monitors it, displaying all the events layer events as they get generated. it's giving surveillance but make it helpful ๐Ÿฆ‹

If you pass the --grab flag in capture mode, evtest keeps an EVIOCGRAB on the device. While that grab is active, other processes will not receive events from the kernel devices. Like, none. It's holding the aux cord and nobody else gets a turn ๐Ÿ”ฅ The grab gets released when evtest quits, so phew.

The second invocation type โ€” "query mode" โ€” is a one-shot. evtest checks the state of one specific key value of an event type, then dips. no vibes, just answers ๐Ÿ’–

type is one of: EV_KEY, EV_SW, EV_SND, EV_LED (or the numerical value)

value can be either a decimal representation (e.g. 44), hex (e.g. 0x2c), or the constant name (e.g. KEY_Z) of the key/switch/sound/LED being queried. so many options, pick your fighter โœจ

If the state bit is set (key pressed, switch on, ...), evtest exits with code 10. If the state bit is unset (key depressed, switch off, ...), evtest exits with code 0. No other output is generated. that's it, that's the whole message ๐Ÿซถ

evtest needs to be able to read from the device; in most cases this means it must be run as root. ๐Ÿ‘‘

evtest is commonly used to debug issues with input devices in X.Org. The output of evtest shows the information presented by the kernel; based on this information it can be determined whether a bug may be a kernel or an X.Org issue. it's literally the vibe check that tells you whose fault it is ๐Ÿ˜ญ


๐Ÿ’€ DIAGNOSTICS ๐Ÿ’€

If evtest does not show any events even though the device is being used, the device may be grabbed by a process (EVIOCGRAB). This is usually the case when debugging a synaptics device from within X. VT switching to a TTY or shutting down the X server terminates this grab and synaptics devices can be debugged. so if it's being sus and silent, someone else is hogging it ๐Ÿ™ˆ

The following command shows the processes with an open file descriptor on the device:

fuser -v /dev/input/eventX

like, this is the "who's in my seat" command, iykyk ๐Ÿ’…


๐ŸŒˆ EXIT CODE ๐ŸŒˆ

evtest returns 1 on error. ๐Ÿ˜ญ

When used to query state, evtest returns 0 if the state bit is unset and 10 if the state bit is set.


โญ SEE ALSO โญ

inputattach(1)


๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

evtest was written by Vojtech Pavlik <vojtech@suse.cz[1]>. absolute icon behavior ๐Ÿซถ

This manual page was written by Stephen Kitt <steve@sk2.org[2]>, based on that present in the lineakd package, for the Debian GNU/Linux system (but may be used by others). iconic and generous of them fr fr โœจ


๐Ÿ“ NOTES ๐Ÿ“

  1. vojtech@suse.cz mailto:vojtech@suse.cz
  2. steve@sk2.org mailto:steve@sk2.org

and that's the whole page, bestie ๐Ÿ’– this one is straight outta the EVTEST(1) manual, dated 08/28/2025 โ€” go forth and debug your input devices, you absolute main character ๐ŸŒธ๐Ÿ’…

๐Ÿ“ฆ where this page comes from