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
This commit is contained in:
commit
7939132267
78 files changed
+6990
No files matched your search
+20
@@ -0,0 +1,20 @@
|
||||
#include "KeyState.h"
|
||||
|
||||
|
||||
void
|
||||
KeyState_init(KeyState *self, byte probeBit, BOOL testBit)
|
||||
{
|
||||
self->probeBit = probeBit;
|
||||
self->testBit = testBit;
|
||||
self->pressedPreviously = FALSE;
|
||||
}
|
||||
|
||||
|
||||
BOOL
|
||||
KeyState_update(KeyState *self)
|
||||
{
|
||||
BOOL pressedNow = isKeyPressed(self->probeBit, self->testBit);
|
||||
BOOL justPressed = (!self->pressedPreviously && pressedNow);
|
||||
self->pressedPreviously = pressedNow;
|
||||
return justPressed;
|
||||
}
|
||||
Reference in new issue
Block a user