summaryrefslogtreecommitdiff
path: root/src/keypad.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/keypad.c')
-rw-r--r--src/keypad.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/keypad.c b/src/keypad.c
index f26c5e2..2ff7be4 100644
--- a/src/keypad.c
+++ b/src/keypad.c
@@ -19,7 +19,7 @@ int map[]={
KEY_V // F
};
-int KeypadKeycodeValid(int keycode){
+int KeypadGetKey(int keycode){
for(int i=0;i<16;i++){
if(map[i]==keycode)
return i;
@@ -29,9 +29,9 @@ int KeypadKeycodeValid(int keycode){
int KeypadGetPressed(){
- int keycode=GetKeyPressed();
- if(keycode){
- return KeypadKeycodeValid(keycode);
+ for(int i=0;i<16;i++){
+ if(IsKeyDown(map[i]))
+ return i;
}
return -1;
}