2018-04-28 11:30:53 -04:00
|
|
|
#ifndef DGL_DGLKYBRD_H_INCLUDED
|
|
|
|
#define DGL_DGLKYBRD_H_INCLUDED
|
2017-11-26 13:18:33 -05:00
|
|
|
|
2018-04-28 11:30:53 -04:00
|
|
|
#include "dglcmn.h"
|
|
|
|
#include "dglkeys.h"
|
2017-11-26 13:18:33 -05:00
|
|
|
|
|
|
|
typedef byte KEY;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Current state of the keyboard.
|
|
|
|
*/
|
2018-04-28 11:30:53 -04:00
|
|
|
extern volatile ubyte keys[128];
|
2017-11-26 13:18:33 -05:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Installs a custom keyboard interrupt handler.
|
|
|
|
* @return TRUE on success
|
|
|
|
*/
|
|
|
|
boolean keyboard_init(void);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Removes a previously installed keyboard interrupt handler.
|
|
|
|
* @return TRUE on success
|
|
|
|
*/
|
|
|
|
boolean keyboard_shutdown(void);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @return TRUE if the custom keyboard interrupt handler is installed.
|
|
|
|
*/
|
|
|
|
boolean keyboard_is_initialized(void);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Waits indefinitely until any key is pressed.
|
|
|
|
* @return The key that was pressed.
|
|
|
|
*/
|
|
|
|
KEY keyboard_read_key(void);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Waits indefinitely until the specified key is pressed.
|
|
|
|
*/
|
|
|
|
void keyboard_wait_for_key(KEY key);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|