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

the input core: /dev/input, one stream of key, button, motion and wheel events from every input driver. More...

#include "common/stdint.h"
#include "input_event.h"

Go to the source code of this file.

Functions

void input_init (void)
 make /dev/input.
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.

Detailed Description

the input core: /dev/input, one stream of key, button, motion and wheel events from every input driver.

drivers call input_report for each change and input_sync at the end of a group. each open of /dev/input has its own queue, so several programs can read the events; a reader that falls behind loses its oldest events and gets SYN_DROPPED.

Function Documentation

◆ input_init()

void input_init ( void )

make /dev/input.

call once, after device_registry_init.

◆ 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.