Files
dusk/src/input/inputaction.hpp
Dominic Masters ee3d27fda3
Some checks failed
Build Dusk / build-linux (push) Failing after 1m14s
Build Dusk / build-psp (push) Failing after 1m21s
Time -> manager
2025-12-22 14:33:26 +10:00

50 lines
1.3 KiB
C++

/**
* Copyright (c) 2025 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include "time/TimeManager.hpp"
typedef uint8_t inputaction_t;
#define INPUT_ACTION_NULL 0x00
#define INPUT_ACTION_UP 0x01
#define INPUT_ACTION_DOWN 0x02
#define INPUT_ACTION_LEFT 0x03
#define INPUT_ACTION_RIGHT 0x04
#define INPUT_ACTION_ACCEPT 0x05
#define INPUT_ACTION_CANCEL 0x06
#define INPUT_ACTION_RAGEQUIT 0x07
#define INPUT_ACTION_COUNT INPUT_ACTION_RAGEQUIT + 1
typedef struct {
inputaction_t action;
float_t lastValue;
float_t currentValue;
#if TIME_FIXED == 0
float_t lastDynamicValue;
float_t currentDynamicValue;
#endif
} inputactiondata_t;
// static const char_t* INPUT_ACTION_NAMES[INPUT_ACTION_COUNT] = {
// [INPUT_ACTION_UP] = "UP",
// [INPUT_ACTION_DOWN] = "DOWN",
// [INPUT_ACTION_LEFT] = "LEFT",
// [INPUT_ACTION_RIGHT] = "RIGHT",
// [INPUT_ACTION_ACCEPT] = "ACCEPT",
// [INPUT_ACTION_CANCEL] = "CANCEL",
// [INPUT_ACTION_RAGEQUIT] = "RAGEQUIT",
// };
/**
* 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);