Skip to content

InputConfig ​

Struct

Source: InputConfig.h

Description ​

Configuration structure for the InputManager.

Maps logical inputs to physical GPIO pins (ESP32) or keyboard scancodes (Native/SDL2). Uses fixed-size std::array instead of std::vector for zero-allocation and deterministic memory usage on ESP32.

Usage:

cpp
// ESP32
pr32::input::InputConfig config(BTN_UP, BTN_DOWN, BTN_LEFT, BTN_RIGHT);

// Native (SDL2)
pr32::input::InputConfig config(SDL_SCANCODE_UP, SDL_SCANCODE_DOWN);

// Empty
pr32::input::InputConfig config{};

InputManager

Properties ​

NameTypeDescription
MAX_INPUT_COUNTstatic constexpr size_tMaximum number of inputs supported (compile-time fixed size).
buttonNamesstd::array<uint8_t, MAX_INPUT_COUNT>Array of SDL scancodes for Native platform.
inputPinsstd::array<int, MAX_INPUT_COUNT>Array of GPIO pin numbers for ESP32.
countsize_tTotal number of configured inputs (auto-deduced from constructor arguments).

Released under the MIT License.