diff options
author | kdx <kikoodx@paranoici.org> | 2024-04-14 14:12:22 +0200 |
---|---|---|
committer | kdx <kikoodx@paranoici.org> | 2024-04-14 14:19:26 +0200 |
commit | 1fe0d9dddd7b4b0fc59cb36570fa04ed52329a06 (patch) | |
tree | a2925694da725378e8eb24075e5f8296ef6ecede | |
parent | ca7deb67edcdd946173e63bfb89e04b33eb2eb64 (diff) | |
download | input-1fe0d9dddd7b4b0fc59cb36570fa04ed52329a06.tar.gz |
-rw-r--r-- | input.c | 11 | ||||
-rw-r--r-- | input.h | 1 |
2 files changed, 12 insertions, 0 deletions
@@ -227,6 +227,17 @@ input_get_binds(const char *tag) } bool +input_scancode_in_use(SDL_Scancode sc, bool only_locked) +{ + foreach (action, _actions.next) + foreach (bind, action->binds.next) + if (bind->type == IBT_SCANCODE && bind->sc == sc && + (!only_locked || bind->lock)) + return true; + return false; +} + +bool input_down(const char *tag) { InputAction *action = _input_get_action(tag); @@ -66,6 +66,7 @@ void input_bind_action_tzr(const char *tag, TZR_Event e); void input_bind_axis_gc(const char *tag, SDL_GameControllerAxis ax); void input_bind_axis_act(const char *tag, const char *l, const char *r); InputBind *input_get_binds(const char *tag); +bool input_scancode_in_use(SDL_Scancode sc, bool only_locked); bool input_down(const char *tag); bool input_up(const char *tag); |