kernel generic keyboard interface
More...
#include <stdbool.h>
#include "keycode.h"
Go to the source code of this file.
|
| typedef bool(* | hal_poll_func_t) (void) |
| | typedef for generic hal polling function pointer.
|
| |
kernel generic keyboard interface
◆ hal_poll_func_t
| typedef bool(* hal_poll_func_t) (void) |
typedef for generic hal polling function pointer.
This allows us, when initializing the keyboard to pass a polling function (e.g. ps2_poll) dynamically.
◆ keyboard_get_state()
get the current modifier state of the keyboard
- Returns
- a pointer to the keyboard's struct keyboard_state
◆ keyboard_init()
function to initialize the kernel keyboard system
- Parameters
-
| poll | generic HAL keyboard polling function |
- Returns
- whether initialization passed or failed
◆ keyboard_poll()
function to poll the keyboard for available events
- Returns
- true if new data has been pushed to event queue
- Note
- typically is called from irq.c, direct polling is slow
◆ keyboard_pop_event()
pop an event from the keyboard event queue.
- Parameters
-
| event | buffer to store new event data in |
- Returns
- whether there was any data in queue to pop
◆ keyboard_push_event()
push event to the keyboard event queue
- Parameters
-
| event | event to push to the queue |
- Note
- can be used to simulate keypresses.
-
This function is typically called directly from the HAL keyboard driver. see ps2_keyboard.c for an example