The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
input.h
Go to the documentation of this file.
1#pragma once
2
3/**
4 * @file input.h
5 * @brief the input core: /dev/input, one stream of key, button, motion
6 * and wheel events from every input driver.
7 *
8 * drivers call input_report for each change and input_sync at the end of
9 * a group. each open of /dev/input has its own queue, so several programs
10 * can read the events; a reader that falls behind loses its oldest events
11 * and gets SYN_DROPPED.
12 */
13
14#include "common/stdint.h"
15#include "input_event.h"
16
17/**
18 * make /dev/input. call once, after device_registry_init.
19 */
20void input_init(void);
21
22/**
23 * report one change. safe in an interrupt handler.
24 * @param type EV_KEY, EV_REL or EV_ABS.
25 * @param code the key, button or axis.
26 * @param value the new state or the change.
27 */
28void input_report(uint16_t type, uint16_t code, int32_t value);
29
30/**
31 * end a group of events (EV_SYN / SYN_REPORT). safe in an interrupt
32 * handler.
33 */
34void input_sync(void);
35
36/**
37 * true while a reader holds the keyboard (INPUT_IOC_GRAB): the keyboard
38 * driver then gives its keys only to /dev/input, not to the console.
39 */
40bool input_keyboard_grabbed(void);
void input_init(void)
make /dev/input.
Definition input.c:273
void input_sync(void)
end a group of events (EV_SYN / SYN_REPORT).
Definition input.c:94
void input_report(uint16_t type, uint16_t code, int32_t value)
report one change.
Definition input.c:89
bool input_keyboard_grabbed(void)
true while a reader holds the keyboard (INPUT_IOC_GRAB): the keyboard driver then gives its keys only...
Definition input.c:99
the events of /dev/input (ABI).
unsigned short uint16_t
Definition stdint.h:13
int int32_t
Definition stdint.h:14