Skip to content

Step 4 Key Rebinding

BavGames edited this page Jul 6, 2026 · 2 revisions

Step 4: Key Rebinding & Controls

How it works

OptiKit patches runtime copies of your Input Mapping Contexts - your source assets are never modified (verified by checksum in the test suite). Overrides persist in OptiKit's save file and are re-applied at game start and after every map load.

Requires the Enhanced Input project classes from Step 1.

Register your actions

The rebind rows come from a Rebindable Action Set Data Asset (UOkRebindableActionSet). The shipped /OptiKit/Input/DA_OkActions covers the demo (Move/Look/Jump/Fire/Interact); replace it with your own:

  1. Create a Rebindable Action Set Data Asset in your content.
  2. Add one entry per action: Action Id, the Input Action asset, its Source Context (the IMC where its keys live), a localized Display Name.
  3. Flags per entry:
    • Allow Rebind off = the action gets sensitivity/deadzone treatment but no rebind row (movement axes typically).
    • Look Action on = mouse/stick sensitivity and invert modifiers target it.
  4. Point the Ctrl.Rebinds definition (or your copy of it) at your set.

Keys held by non-rebindable actions are reserved - Replace can never silently unbind movement.

image

What players get

  • One row per rebindable action, primary + secondary slot, separate keyboard and gamepad sets (device tab buttons appear on key-bind pages automatically).
  • Press-to-capture with timeout; Escape cancels a capture.
  • Conflicts inside the rebindable set resolve through a Swap / Replace / Cancel dialog.
  • Key glyphs come from the theme's key-icon library (Step 5); without an icon the key name is shown as text.
  • Reset All Bindings restores the source-context defaults behind a confirmation.
image

Sensitivity, invert, deadzone

Ctrl.MouseSensitivity, Ctrl.GamepadSensitivityX/Y, Ctrl.InvertX/Y and Ctrl.GamepadDeadzone attach OptiKit-owned modifiers to the runtime mappings, composing with your own designer modifiers. The deadzone is ordered before the scalar, so high sensitivity cannot saturate the deadzone.

Reserved keys

Project Settings → Plugins → OptiKit → Reserved Rebind Keys lists keys players may never bind (menu navigation must stay reachable). Escape and the gamepad navigation keys ship reserved; add your custom menu-close key if you changed it.

Next: Step 5: Theming & Reskin

Clone this wiki locally