Home

GdkDevice

GdkDevice is an object in the GDK library used by GTK applications to represent an input device. It provides a programmatic handle to hardware such as mice, keyboards, touchscreens, and drawing tablets, abstracted to work across different display systems like X11 and Wayland. Each device has an identity, a type (for example pointer-like, keyboard-like, or touch-like), a source that indicates the original hardware family, and a set of capabilities describing which kinds of events the device can generate (movement, button presses, touch contact, pressure, tilt). Applications can query these properties to implement per-device behavior, filter input sources, or collect per-device statistics.

Events in GDK can be associated with a specific GdkDevice, enabling applications to distinguish input from

Common use cases include handling per-device motion or pressure data from tablets and styluses, or recognizing

Related topics include GdkSeat, which groups devices for a user session, and GdkDisplay, which manages the overall

multiple
devices.
The
device
objects
are
created
by
the
display
subsystem
and
are
typically
tied
to
a
seat,
representing
a
group
of
devices
that
can
provide
input
to
the
session.
GdkDevice
is
a
GObject
and
participates
in
the
library's
reference
counting
and
lifecycle
management.
when
an
input
comes
from
a
dedicated
keyboard
versus
a
pointer
device.
In
multi-input
environments,
managing
devices
through
GdkDevice
helps
applications
provide
more
precise
and
customizable
input
handling.
display
and
input
topology.
This
article
summarizes
the
role
of
GdkDevice
in
the
GDK
input
subsystem.