LinuxCommandLibrary

xev

TLDR

Start xev

$ xev
copy
Show specific event types
$ xev -event [keyboard]
copy
Monitor specific window
$ xev -id [window_id]
copy
Use root window
$ xev -root
copy
Show only key events
$ xev -event keyboard
copy

SYNOPSIS

xev [-event type] [-id window] [-root] [options]

DESCRIPTION

xev displays X11 events. It shows what the X server receives.
Window opens to capture events. Click, type, move mouse.
Event details are printed. Keycodes, coordinates, modifiers.
Useful for debugging input. Find keycodes for configuration.
Window ID mode monitors other windows. Spy on specific applications.
Root mode catches global events. Display-wide monitoring.

PARAMETERS

-event TYPE

Event type filter.
-id WINDOW
Window ID.
-root
Root window.
-name NAME
Window name.
-geometry GEOM
Window geometry.

EVENT TYPES

keyboard - Key events
mouse - Pointer events
button - Button events
motion - Motion events
expose - Expose events

CAVEATS

X11 only, not Wayland. Creates visible window. Output is verbose.

HISTORY

xev is part of the standard X11 utilities. It's essential for understanding X input events and configuring key bindings.

SEE ALSO

xdotool(1), xmodmap(1), xinput(1)

Copied to clipboard