Home

evdev

evdev, short for event device, is a Linux kernel interface that exposes input devices to user space in a uniform, event-driven manner. It is part of the Linux input subsystem and provides a standard way for applications to receive events from keyboards, mice, touchscreens, joysticks, and other input hardware.

Each physical input device is represented by a character device under /dev/input, typically /dev/input/eventX. Userspace programs

Applications can query device capabilities using ioctls to list supported event types and codes and can grab

History and usage: The evdev interface has been part of the kernel's input subsystem for many years

read
a
stream
of
input_event
records,
each
containing
a
timestamp,
a
type
(such
as
EV_KEY,
EV_REL,
EV_ABS,
EV_SYN),
a
code,
and
a
value.
EV_KEY
carries
key
or
button
events;
EV_REL
covers
relative
motion
(e.g.,
mouse
movement);
EV_ABS
covers
absolute
coordinates
(e.g.,
touchscreens);
EV_SYN
synchronizes
event
packets.
Codes
(like
KEY_A,
BTN_LEFT,
ABS_X,
REL_X)
identify
the
specific
control
within
the
event
type.
devices
to
prevent
other
processes
from
receiving
events.
Common
user-space
libraries,
such
as
libevdev
and
libinput,
provide
higher-level
access
to
evdev
devices
and
are
used
by
graphical
environments
and
input
stacks
on
Linux.
and
underpins
modern
input
handling
in
Linux.
It
is
used
by
desktop
environments,
Wayland
compositors,
and
many
multimedia
applications.
It
complements
other
input
subsystems
and
tools,
including
uinput
for
injecting
synthetic
events,
and
serves
as
a
foundational
API
for
both
system-level
and
user-space
input
processing.