🎮 Input System
Cross-platform input handling with automatic switching between mouse/touch and gamepad. Features a context-based bind system that prevents conflicts between different modes.
Interaction Manager
Automatic input type detection and mode switching.
→Console Modes
Combat vs Inventory mode switching and state management.
→Selection States
Selection flow for swapping, dropping, and quick moving.
→Binds Module
Context-based input system for conflict-free bindings.
→Architecture Overview
How the input system works together
UserInputService.PreferredInput
|
+-- Mouse/Touch
| |
| +-- InteractionManager
| |
| +-- DragHandler.Enabled = true
| +-- ConsoleModeManager.Destroy()
|
+-- Gamepad
|
+-- InteractionManager
|
+-- DragHandler.Enabled = false
+-- ConsoleModeManager.Init()
|
+-- Mode Indicator (HUD badge)
|
+-- Combat Mode (L3 long press)
| |
| +-- Hotbar binds enabled
| +-- Selection disabled
|
+-- Inventory Mode
|
+-- SelectionManager.Enabled = true
+-- Selection States: Idle → Source → Target/Drop
Key Components
Each module's responsibility
| Component | File | Purpose |
|---|---|---|
| InputManager | InputManager.luau | Creates IllusionIAS contexts and manages bind lifecycle |
| InteractionManager | InteractionManager.luau | Detects input type, switches between DragHandler and ConsoleMode |
| ConsoleModeManager | ConsoleModeManager.luau | Manages Combat/Inventory modes with visual indicator |
| SelectionManager | SelectionManager.luau | Handles slot selection flow for gamepad users |
| Binds | Binds.luau | Centralized bind configuration with PC/Console support |
Context System
How IllusionIAS contexts prevent bind conflicts
Stoway uses four contexts to organize binds. This allows the same physical key to do different things in different modes:
Always enabled. Contains backpack toggle and mode switch.
Enabled in Combat mode. Hotbar slot selection for equipping.
Enabled in Inventory mode. Selection and actions.
Enabled when dropping. Amount adjustment.
See Binds Module for detailed configuration.
Console Mode Flow
How gamepad users interact with inventory
Combat Mode
Character controls active
- Hotbar slots work
- Inventory closed
- Selection disabled
Inventory Mode
UI navigation active
- D-Pad navigates slots
- Y: Swap
- X: Drop
- A: Quick Move
- B: Cancel
Customization
Modifying the input system