Overview
IInputSystem is the abstract interface for input subsystems in ReXGlue. It provides dependency injection for different input backends, with SDL as the primary implementation for game controller support.
Header: rex/system/interfaces/input.h
Namespace: rex::system
Interface Methods
Setup
X_STATUS - Status code indicating success or failure
Shutdown
Concrete Implementation
InputSystem
Class:rex::input::InputSystem
Header: rex/input/input_system.h
Input system implementation supporting multiple input drivers.
SDL Input Driver
Class:rex::input::sdl::SDLInputDriver
Header: rex/input/sdl/sdl_input_driver.h
SDL-based input driver providing game controller and keyboard support.
HID_SDL_USER_COUNT = 4- Maximum simultaneous users/controllersHID_SDL_THUMB_THRES = 0x4E00- Thumbstick deadzone thresholdHID_SDL_TRIGG_THRES = 0x1F- Trigger activation thresholdHID_SDL_REPEAT_DELAY = 400- Key repeat delay in millisecondsHID_SDL_REPEAT_RATE = 100- Key repeat rate in milliseconds
Factory Function
InputSystem with appropriate drivers:
- Normal mode: SDL driver + NOP driver
- Tool mode: NOP driver only (no physical input)
tool_mode- If true, creates system without SDL driver for headless operation
Example Usage
Creating Input System
Manual Input System Creation
Reading Controller State
Setting Controller Vibration
Reading Keystrokes
Tool Mode (Headless)
Multi-User Support
The input system supports up to 4 simultaneous users (controllers):See Also
- IGraphicsSystem - Graphics subsystem interface
- IAudioSystem - Audio subsystem interface
- KernelState - Kernel state management