Skip to main content
Prisma Engine routes all player input through a two-layer Driver-Device abstraction. 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:
Driver source files live in src/engine/input/drivers/.

Backend drivers

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

Cursor control is available for first-person cameras or UI modes:

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:
Your 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:
SDL3 input is recommended during cross-platform development and testing. Switch to the native driver (PRISMA_USE_NATIVE_INPUT=ON) for a production Windows or Android build where you need XInput rumble or GameActivity-specific features.