Skip to main content

Module uinput

Module uinput 

Source
Expand description

Kernel uinput devices, the first rung of host-capture input injection. Kernel input devices for host-capture injection, over /dev/uinput.

A host session takes its input from the kernel, so a uinput keyboard and pointer reach it whatever display server it runs: no compositor protocol to advertise, no portal on the bus, and no consent dialog to answer. That puts it on the host-capture input ladder below libei and the virtual keyboard and pointer protocols, which a compositor may not offer, and above the portal’s own methods (a socket write to the compositor lands in about 4 us, a uinput write in about 12 us, a portal call in about 2 ms); it is taken only where /dev/uinput is writable β€” a bare-metal host rather than an unprivileged container.

The pointer carries a normalized absolute axis rather than the layout’s own pixels: a uinput device fixes its axis range when the kernel creates it, while the union layout changes whenever a display is added or resized.

StructsΒ§

AbsInfo πŸ”’
Device
One kernel device: the fd that created it carries its events until it drops.
InputEvent πŸ”’
InputId πŸ”’
Pair
The keyboard and pointer one host session injects through.
UinputAbsSetup πŸ”’
UinputSetup πŸ”’

ConstantsΒ§

ABS_RANGE
The span an absolute axis is declared over; positions are scaled onto it.
ABS_X
ABS_Y
BTN_LEFT πŸ”’
BTN_MIDDLE πŸ”’
BTN_MISC πŸ”’
BTN_RIGHT πŸ”’
BUS_VIRTUAL πŸ”’
EV_ABS
EV_KEY
EV_REL
EV_SYN
IOC_WRITE πŸ”’
REL_HWHEEL
REL_WHEEL
REL_X
REL_Y
SYN_REPORT πŸ”’
UINPUT_NAME_LEN πŸ”’
UI_ABS_SETUP πŸ”’
UI_DEV_CREATE πŸ”’
UI_DEV_DESTROY πŸ”’
UI_DEV_SETUP πŸ”’
UI_SET_ABSBIT πŸ”’
UI_SET_EVBIT πŸ”’
UI_SET_KEYBIT πŸ”’
UI_SET_RELBIT πŸ”’

FunctionsΒ§

available
Whether this process can create kernel input devices.
io πŸ”’
_IO('U', nr), for the ioctls that carry no argument.
iow πŸ”’
_IOW('U', nr, size), the encoding <linux/uinput.h> gives its setup ioctls.
set πŸ”’ βš