Allowed binds to execute commands.

This commit is contained in:
2025-09-11 12:58:04 -05:00
parent fe9af039fc
commit 8b20f0bf31
13 changed files with 244 additions and 251 deletions

36
src/input/inputaction.h Normal file
View File

@@ -0,0 +1,36 @@
/**
* Copyright (c) 2025 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include "dusk.h"
typedef enum {
INPUT_ACTION_UP,
INPUT_ACTION_DOWN,
INPUT_ACTION_LEFT,
INPUT_ACTION_RIGHT,
INPUT_ACTION_ACCEPT,
INPUT_ACTION_CANCEL,
INPUT_ACTION_COUNT
} inputaction_t;
typedef struct {
inputaction_t action;
float_t lastValue;
float_t currentValue;
} inputactiondata_t;
extern const char_t* INPUT_ACTION_NAMES[INPUT_ACTION_COUNT];
/**
* Gets an input action by its name.
*
* @param name The name of the input action.
* @return The input action, or INPUT_ACTION_COUNT if not found.
*/
inputaction_t inputActionGetByName(const char_t *name);