diff options
| author | Loic Guegan <loic.guegan@mailbox.org> | 2023-12-26 13:17:52 +0100 |
|---|---|---|
| committer | Loic Guegan <loic.guegan@mailbox.org> | 2023-12-26 13:17:52 +0100 |
| commit | e9ec67945034935931c975ddb9522a5dbb69e6a9 (patch) | |
| tree | e15f223eb984b71eda672978de0643d6e4475d2a /src/keypad.c | |
| parent | 3738e41d2db8c058c684ab602309c98464d8e6f6 (diff) | |
Minor changes
Diffstat (limited to 'src/keypad.c')
| -rw-r--r-- | src/keypad.c | 8 |
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; } |
