Input

Keyboard, gamepad and touch: actions and bindings, reacting to them, moving through windows, the pause menu and on-screen prompts.

Actions and keys

Keyboard, gamepad (incl. Steam Deck) and touch all produce the same actions. Content reacts to actions, never to raw keys.

// src/content/config/input.ts
export default defineInput({
  actions: {
    up: { keys: ['ArrowUp', 'KeyW'], buttons: [GP.DpadUp], stick: 'up' },
    confirm: { keys: ['Enter', 'Space', 'KeyF'], buttons: [GP.A] },
    cancel: { keys: ['Escape', 'Backspace'], buttons: [GP.B] },
    menu: { keys: ['Escape'], buttons: [GP.Start] },          // Escape is cancel too: see Pause menu
    inventory: { keys: ['KeyE'], buttons: [GP.X], vnMode: false }, // not in VN-only mode
    // padLocked / padResetInMenus: see Touch, gamepads and prompts below
    map_marker: { keys: ['KeyM'], buttons: [GP.LeftStick] },  // a new action: now typed everywhere
  },
  backButton: ['cancel', 'menu'],                           // Android's Back: the first that does something
  touchButtons: [
    { action: 'confirm', label: 'A', layers: ['map'] },     // only over the map
    { action: 'cancel', label: 'B', layers: ['map'] },
    { action: 'inventory', label: 'Bag', layers: ['map'] },
    // place: 'top-right' pins a button to the top right corner instead
  ],
})

Default controls

ActionKeyboardController
Move / chooseArrows, WASDD-pad, left stick
Confirm / cancelEnter, Space, F / Escape, BackspaceA / B (Nintendo: see Confirm with)
Pause menuEscapeStart
Inventory (not in VN-only mode)EX
Skip (hold) / back a lineCtrl / Page UpRT / LB
Auto-play / log / hide the text boxT / L / HRB / View / Y
Previous / next tabQ / RLB / RB
Quick save / quick loadF5 / F9none (players can add one)
Screenshot / fullscreenF8 / F11(the console's own screenshot button)

Reacting to actions

// React (any screen): active on the screen the component belongs to
useAction('map_marker', () => placeMarker())
useAction('cancel', () => { if (!submenu) return false; closeSubmenu() })   // false = pass it on
useAction('inventory', toggle, { layers: ['map', 'windows'] })                // also while windows are open
const skipping = useHeld('skip')                                              // held down right now

// Game loops and scripts
game.input.isDown('confirm')
game.input.move('map')        // { x, y } from arrows / stick / joystick, -1..1

Pause menu

The Menu action (Escape, Start on a pad, or the ☰ button) opens the pause menu, the window windows/menu: a grid of buttons (arrows or d-pad move between them) that reaches every window: Inventory, Quests, Party, Journal, Save, Load, Settings, Log (during a scene), I'm stuck (on a map), Title and Quit (desktop app). Escape also closes the front window (it is cancel too). One key or pad button press goes to one action, the first one that takes it, so Escape on a window closes only that window, and B that closes a window does not also hide the text box under it. The Menu button also closes the front window (unless a handler takes it first), so the pad button that opened the menu backs out of it one window at a time, as Escape does. Inventory also has its own key, E (X on a pad), next to WASD; confirm is F, Enter or Space. Tabs in Journal, Extras and Settings switch with Q / R (LB / RB on a pad). Those are the actions tabPrev and tabNext; any window with tabs can use useTabs(setTab, [...]).

Clicking outside a window

A click or tap outside every window closes the top one (one at a time) and does nothing else: while a window is open, nothing under it can be clicked (the map, a scene and its toolbar, the title menu). Clicking inside another window brings it to the front instead. Windows marked closable: false stay open, and still block the click. The ☰ button stays usable.

Touch, gamepads and prompts