InputConfig
StructSource: 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
| Name | Type | Description |
|---|---|---|
MAX_INPUT_COUNT | static constexpr size_t | Maximum number of inputs supported (compile-time fixed size). |
buttonNames | std::array<uint8_t, MAX_INPUT_COUNT> | Array of SDL scancodes for Native platform. |
inputPins | std::array<int, MAX_INPUT_COUNT> | Array of GPIO pin numbers for ESP32. |
count | size_t | Total number of configured inputs (auto-deduced from constructor arguments). |
