Allowed binds to execute commands.
This commit is contained in:
36
src/input/inputaction.h
Normal file
36
src/input/inputaction.h
Normal 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);
|
||||
Reference in New Issue
Block a user