-
Notifications
You must be signed in to change notification settings - Fork 0
Step 4 Key Rebinding
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.
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:
- Create a Rebindable Action Set Data Asset in your content.
- Add one entry per action: Action Id, the Input Action asset, its Source Context (the IMC where its keys live), a localized Display Name.
- 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.
- Point the
Ctrl.Rebindsdefinition (or your copy of it) at your set.
Keys held by non-rebindable actions are reserved - Replace can never silently unbind movement.
- 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.
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.
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