🎮 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

Input System Flow Diagram
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:

StowayGlobal

Always enabled. Contains backpack toggle and mode switch.

Tab B DPadLeft
StowayCombat

Enabled in Combat mode. Hotbar slot selection for equipping.

1-9 R1+X L1+X
StowayInventory

Enabled in Inventory mode. Selection and actions.

Y (Swap) X (Drop) A (QuickMove) B (Cancel)
StowayDrop

Enabled when dropping. Amount adjustment.

DPadUp DPadDown

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
Long Press L3
🎒

Inventory Mode

UI navigation active

  • D-Pad navigates slots
  • Y: Swap
  • X: Drop
  • A: Quick Move
  • B: Cancel
From Inventory Mode
X pressedDrop Mode

Customization

Modifying the input system