InputDevice is the high-level interface your game code talks to; it delegates the actual platform API calls to a pluggable IInputDriver. SDL3 is the default cross-platform driver; Win32 (RawInput + XInput) and GameActivity are the native alternatives for Windows and Android respectively.
Driver-Device pattern
InputDevice::Initialize selects the driver at startup. Pass InputDriverType::Auto to let the engine choose the best driver for the current platform, or specify one explicitly:
src/engine/input/drivers/.
Backend drivers
- SDL3 (cross-platform)
- Win32 (Windows native)
- GameActivity (Android)
InputDriverSDL3 wraps SDL3’s unified event queue. It handles keyboard, mouse, and gamepad events on all three supported platforms (Windows, Linux, Android) without any extra configuration.Source: src/engine/input/drivers/InputDriverSDL3.*Enable by setting PRISMA_USE_NATIVE_INPUT=OFF, or let Auto select SDL3 on Linux:Input types
Keyboard
KeyCode covers the full printable ASCII range plus function keys (F1–F12), arrow keys, modifiers (LeftShift, LeftCtrl, LeftAlt, etc.), and navigation keys (Escape, Tab, Backspace, Delete).
Mouse
Gamepad
Text input
For UI text fields, enable raw character delivery instead of keycodes:Action mappings
InputDevice supports named action bindings that decouple game logic from physical keys or buttons. A binding can have a primary key, an alternate key, and a gamepad button — the action fires if any of them is active.
InputManager and event flow
InputManager is a subsystem owned by the engine core (src/engine/input/InputManager.*). It implements ISubSystem and receives events dispatched by the engine’s main loop:
Application subclass receives the same events via Application::OnEvent(). Query the InputManager state after OnEvent returns:
CMake configuration
To force SDL3 input on all platforms: