From 500eeb7ee3c06b0e3a2433eeaad67261736ac1f5 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Thu, 23 Jul 2015 23:59:53 -0700 Subject: [PATCH] GBA Input: Unbind axes at the appropriate time --- src/gba/input.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gba/input.c b/src/gba/input.c index 1d9ccba74..6695a619d 100644 --- a/src/gba/input.c +++ b/src/gba/input.c @@ -366,7 +366,6 @@ void GBAInputUnbindKey(struct GBAInputMap* map, uint32_t type, enum GBAKey input if (impl) { impl->map[input] = GBA_NO_MAPPING; } - TableEnumerate(&impl->axes, _unbindAxis, &input); } int GBAInputQueryBinding(const struct GBAInputMap* map, uint32_t type, enum GBAKey input) { @@ -420,6 +419,8 @@ int GBAInputClearAxis(const struct GBAInputMap* map, uint32_t type, int axis, in void GBAInputBindAxis(struct GBAInputMap* map, uint32_t type, int axis, const struct GBAAxis* description) { struct GBAInputMapImpl* impl = _guaranteeMap(map, type); + TableEnumerate(&impl->axes, _unbindAxis, &description->highDirection); + TableEnumerate(&impl->axes, _unbindAxis, &description->lowDirection); struct GBAAxis* dup = malloc(sizeof(struct GBAAxis)); *dup = *description; TableInsert(&impl->axes, axis, dup);