Original author: Pierre Sarrazin. Preserve upstream GPLv3-or-later and file-specific notices. Source: http://sarrazip.com/dev/coco-planes-0.1.0.tar.gz Archive SHA-256: 29191e6ba225965caa637ee726e1189639dc7fcdf2b68310fb93fbffd56c9c52
29 lines
561 B
C
29 lines
561 B
C
#ifndef _H_KeyState
|
|
#define _H_KeyState
|
|
|
|
#include <coco.h>
|
|
|
|
|
|
typedef struct KeyState
|
|
{
|
|
byte probeBit; // KEY_PROBE_*
|
|
byte testBit; // KEY_BIT_*
|
|
BOOL pressedPreviously;
|
|
} KeyState;
|
|
|
|
|
|
// probeBit: KEY_PROBE_* enum value.
|
|
// testBit: KEY_BIT_* enum value.
|
|
//
|
|
void KeyState_init(KeyState *self, byte probeBit, byte testBit);
|
|
|
|
|
|
// Must be called at each frame.
|
|
// Returns TRUE if the key has just been pressed (since the last time
|
|
// that this function was called on this KeyState).
|
|
//
|
|
BOOL KeyState_update(KeyState *self);
|
|
|
|
|
|
#endif /* _H_KeyState */
|