diff options
-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); |