summaryrefslogtreecommitdiff
path: root/source/keyboard.c
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2006-10-10 23:00:37 +0000
committerIan C <ianc@noddybox.co.uk>2006-10-10 23:00:37 +0000
commit5a05c0b7b950e6a76c5ebb9b5f52fa24115013c8 (patch)
treef0677b57f1f22730318d9fe572d98d2badd6c1a0 /source/keyboard.c
parent8b56e05609ccc77f0c0b98b63d8b5640a3b55392 (diff)
Now allows multiple pad keys to be mapped to the same key -- improves City Patrol no end!
Diffstat (limited to 'source/keyboard.c')
-rw-r--r--source/keyboard.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/source/keyboard.c b/source/keyboard.c
index 786b32d..c58aaae 100644
--- a/source/keyboard.c
+++ b/source/keyboard.c
@@ -51,14 +51,24 @@ static SoftKey pad_L_key = NUM_SOFT_KEYS;
static SoftKey pad_start_key = NUM_SOFT_KEYS;
static SoftKey pad_select_key = NUM_SOFT_KEYS;
+#define CLEAR_STATE(SHORTCUT) \
+ do \
+ { \
+ if (SHORTCUT != NUM_SOFT_KEYS && \
+ !key_state[SHORTCUT].handled) \
+ { \
+ key_state[SHORTCUT].new_state = FALSE; \
+ } \
+ } while(0)
+
#define CHECK_STATE(KEYS,BIT,CODE,SHORTCUT) \
do \
{ \
key_state[CODE].new_state = (KEYS & BIT); \
if (SHORTCUT != NUM_SOFT_KEYS && \
- !key_state[SHORTCUT].handled) \
+ !key_state[SHORTCUT].handled && (KEYS & BIT)) \
{ \
- key_state[SHORTCUT].new_state = (KEYS & BIT); \
+ key_state[SHORTCUT].new_state = TRUE; \
} \
} while(0)