Files
CoCoPlanes/KeyState.h
T
Brian Holman 7939132267 Import coco-planes 0.1.0 upstream source snapshot
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
2026-11-09 23:39:59 -07:00

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 */