aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkdx <kikoodx@paranoici.org>2024-04-11 21:54:54 +0200
committerkdx <kikoodx@paranoici.org>2024-04-11 21:54:54 +0200
commitd19711c99ec4279292801edb86a39c24fff35c02 (patch)
tree4c90d3ad78e07e75d8cca98bc09f35e14ed1c576
parentd3c64be44ac87a415fa33bfa17a4635b0c64e549 (diff)
downloadinput-d19711c99ec4279292801edb86a39c24fff35c02.tar.gz
get binds
-rw-r--r--input.c9
-rw-r--r--input.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/input.c b/input.c
index c75e858..d8a058a 100644
--- a/input.c
+++ b/input.c
@@ -143,6 +143,15 @@ input_bind_action_tzr(const char *tag, TZR_Event e)
}
}
+InputBind *
+input_get_binds(const char *tag)
+{
+ InputAction *action = _input_get_action(tag);
+ if (action == NULL)
+ panic("_input_get_action failed");
+ return action->binds.next;
+}
+
bool
input_down(const char *tag)
{
diff --git a/input.h b/input.h
index 8b2296b..e2a682a 100644
--- a/input.h
+++ b/input.h
@@ -62,6 +62,7 @@ void input_bind_action_mb(const char *tag, uint8_t mb);
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_down(const char *tag);
bool input_up(const char *tag);