DungeonCrawl
|
Exposes functions for working with input. More...
Go to the source code of this file.
Functions | |
bool | init_input_handler (struct notcurses *nc) |
Initialize the input handler. | |
bool | get_input_blocking (input_event_t *event) |
Get the next input event (blocking) | |
bool | get_input_nonblocking (input_event_t *event) |
Get the next input event (non-blocking) | |
input_t | translate_input (const ncinput *raw_input) |
Translate a raw Notcurses input to a logical input type. | |
void | shutdown_input_handler (void) |
Shutdown the input handler. |
Exposes functions for working with input.
Definition in file input_handler.h.
bool get_input_blocking | ( | input_event_t * | event | ) |
Get the next input event (blocking)
Waits for an input event and translates it to a logical input type. This function blocks until input is received.
[out] | event | Pointer to an input_event_t structure to fill with the input event |
Definition at line 147 of file input_handler.c.
bool get_input_nonblocking | ( | input_event_t * | event | ) |
Get the next input event (non-blocking)
Checks for an input event and translates it to a logical input type. This function does not block if no input is available.
[out] | event | Pointer to an input_event_t structure to fill with the input event |
Definition at line 181 of file input_handler.c.
bool init_input_handler | ( | struct notcurses * | nc | ) |
Initialize the input handler.
Sets up the input handling system. This function must be called before any other input functions.
nc | The Notcurses instance to use for input handling |
Definition at line 100 of file input_handler.c.
void shutdown_input_handler | ( | void | ) |
Shutdown the input handler.
Cleans up resources. This function should be called when shutting down the game.
Definition at line 212 of file input_handler.c.
input_t translate_input | ( | const ncinput * | raw_input | ) |
Translate a raw Notcurses input to a logical input type.
Helper function to convert from hardware-specific to logical inputs.
raw_input | The raw Notcurses input |
Definition at line 62 of file input_handler.c.