Functions | |
void * | keyhandler (String key, void *data) |
Checks for keyboard input. | |
void * | mousehandler (MOUSE *mouse_s, void *data) |
void * | buttonhandler (BUTTONPTR button, void *data, int type) |
void | execute_on_button_press (void) |
void | execute_on_M_press (void) |
void | return_to_main_menu (GDATAPTR game) |
Handles all keyboard, mouse and button events
void* buttonhandler | ( | BUTTONPTR | button, | |
void * | data, | |||
int | type | |||
) |
Definition at line 188 of file eventhandler.c.
void execute_on_button_press | ( | void | ) |
Definition at line 331 of file eventhandler.c.
void execute_on_M_press | ( | void | ) |
Definition at line 362 of file eventhandler.c.
void* keyhandler | ( | String | key, | |
void * | data | |||
) |
Checks for keyboard input.
This function is called once every frame via a function pointer through keyboard.c keycheck function. All keyboard input is handled here. The void pointer points to a struct of type GDATA to set the the structure member 'quit' and 'gamestarted' to false or true depending on the situation
[in] | key | The pointer to an array of chars which contain the details for which key has been pressed. The array of chars is processed and updated by the keyboard.c routines. |
[out] | *data | A pointer to type void is required to process optional additional data, specifically a pointer to type GDATA is passed to terminate or start the game on certain keystrokes. |
Definition at line 110 of file eventhandler.c.
void* mousehandler | ( | MOUSE * | mouse_s, | |
void * | data | |||
) |
Definition at line 153 of file eventhandler.c.
void return_to_main_menu | ( | GDATAPTR | game | ) |
Definition at line 394 of file eventhandler.c.