|
PatchworkOS
966e257
A non-POSIX operating system.
|
Keyboard abstraction. More...
Keyboard abstraction.
Keyboard devices are exposed as /dev/kbd/[id] directories, containing the following files:
events: A read-only pollable file that can be read to receive keyboard events as kbd_event_t structs.name: A read-only file that contains the keyboard driver specified name (e.g. "PS/2") Data Structures | |
| struct | kbd_t |
| Keyboard structure. More... | |
Macros | |
| #define | KBD_MAX_EVENT 32 |
| Maximum number of queued keyboard events. | |
Functions | |
| kbd_t * | kbd_new (const char *name) |
| Allocate and initialize a keyboard structure. | |
| void | kbd_free (kbd_t *kbd) |
| Free and deinitialize a keyboard structure. | |
| void | kbd_push (kbd_t *kbd, kbd_event_type_t type, keycode_t code) |
| Push a keyboard event to the keyboard event queue. | |
| #define KBD_MAX_EVENT 32 |
| kbd_t * kbd_new | ( | const char * | name | ) |
Allocate and initialize a keyboard structure.
Will make the keyboard available under /dev/kbd/[id].
| name | Driver specified name of the keyboard device. |
NULL and errno is set. Definition at line 87 of file kbd.c.
| void kbd_free | ( | kbd_t * | kbd | ) |
| void kbd_push | ( | kbd_t * | kbd, |
| kbd_event_type_t | type, | ||
| keycode_t | code | ||
| ) |
Push a keyboard event to the keyboard event queue.
The event will be made available to user space by reading the stream file.
| kbd | Pointer to the keyboard structure. |
| type | The type of the keyboard event. |
| code | The keycode of the keyboard event. |
Definition at line 179 of file kbd.c.