The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
input.c File Reference

Macros

#define MAX_READERS   8
 the input core (see input.h).
#define RING_EVENTS   256

Functions

void input_report (uint16_t type, uint16_t code, int32_t value)
 report one change.
void input_sync (void)
 end a group of events (EV_SYN / SYN_REPORT).
bool input_keyboard_grabbed (void)
 true while a reader holds the keyboard (INPUT_IOC_GRAB): the keyboard driver then gives its keys only to /dev/input, not to the console.
void input_init (void)
 make /dev/input.

Macro Definition Documentation

◆ MAX_READERS

#define MAX_READERS   8

the input core (see input.h).

each open of /dev/input is a reader (from the heap) with a ring of events. a report goes into every reader's ring; a full ring drops its oldest event and marks the reader, so its next read starts with SYN_DROPPED.

locking: one spinlock (interrupts off), shared with the drivers' interrupt handlers.

◆ RING_EVENTS

#define RING_EVENTS   256

Function Documentation

◆ input_report()

void input_report ( uint16_t type,
uint16_t code,
int32_t value )

report one change.

safe in an interrupt handler.

Parameters
typeEV_KEY, EV_REL or EV_ABS.
codethe key, button or axis.
valuethe new state or the change.

◆ input_sync()

void input_sync ( void )

end a group of events (EV_SYN / SYN_REPORT).

safe in an interrupt handler.

◆ input_keyboard_grabbed()

bool input_keyboard_grabbed ( void )

true while a reader holds the keyboard (INPUT_IOC_GRAB): the keyboard driver then gives its keys only to /dev/input, not to the console.

◆ input_init()

void input_init ( void )

make /dev/input.

call once, after device_registry_init.