Make every keybind rebindable in Preferences > Controls (menu shortcuts + hard-coded keys) #863

Open
opened 2026-10-19 08:41:06 +00:00 by sky_line · 0 comments
Owner

Every keyboard shortcut in Slipstream should be rebindable in Preferences → Controls.

Today that panel only covers the movement/camera actions registered in llviewerinput.cpp (about 59 actions, saved via key_bindings.xml). Everything else is hard-coded.

Example

Freeze World is Ctrl+Shift+F, set by shortcut="control|shift|F" on the menu item in menu_viewer.xml. It doesn't appear in the Controls panel and can't be changed.

What is hard-coded today

  • Menu accelerators:

    File Shortcuts
    menu_viewer.xml 127
    menu_login.xml 10
    menu_edit.xml 8
    menu_inventory_add.xml, menu_inventory_gear_default.xml 1 each
  • Key checks in code, for example:

    • slfloaterphotostudio.cpp: Ctrl+Z, Ctrl+Y, Ctrl+Shift+Z, Ctrl+F
    • slpanelshapeeditor.cpp: Ctrl+F
    • slchatbar.cpp: Ctrl+Shift
    • llviewerwindow.cpp: Esc, Tab / Ctrl+Tab, the mouselook key, Ctrl/Alt+Up/Down

    A full sweep is part of this ticket.

Scope

  1. Menu shortcuts: list every menu item that has a shortcut= in the Controls panel (grouped by menu). The user can rebind or clear it. The default comes from the XUI.
    • Store overrides with the other bindings (same file/format as the key_bindings user override).
    • Apply them to the menu items at startup and live on change, so menu labels show the current accelerator.
  2. Viewer-global hard-coded keys (llviewerwindow etc.): move them into named actions that the Controls panel can rebind.
  3. Floater-local editing keys (undo/redo/find inside a floater): these may stay standard (Ctrl+Z/Y/F), but list them as rebindable actions where reasonable. At minimum, document them in the panel.
  4. Conflict detection: binding a key already used by another action (in the same mode) warns and offers to swap or clear the other binding.
  5. Reset: reset a single binding or all bindings to defaults.
  6. New features: any new shortcut must register as a bindable action. Add a check (test or CI script) that fails on a shortcut= or a raw key comparison that isn't registered.

Acceptance

  • Ctrl+Shift+F (Freeze World) can be rebound and cleared in Preferences → Controls, and the new key works immediately.
  • Every shortcut= in the menu XUI appears in the Controls panel.
  • Rebinds survive a restart, and the menu shows the rebound accelerator.
  • Conflicts are reported. Reset to default works per-binding and globally.
Every keyboard shortcut in Slipstream should be rebindable in **Preferences → Controls**. Today that panel only covers the movement/camera actions registered in `llviewerinput.cpp` (about 59 actions, saved via `key_bindings.xml`). Everything else is hard-coded. ## Example **Freeze World** is `Ctrl+Shift+F`, set by `shortcut="control|shift|F"` on the menu item in `menu_viewer.xml`. It doesn't appear in the Controls panel and can't be changed. ## What is hard-coded today - **Menu accelerators:** | File | Shortcuts | |---|---| | `menu_viewer.xml` | 127 | | `menu_login.xml` | 10 | | `menu_edit.xml` | 8 | | `menu_inventory_add.xml`, `menu_inventory_gear_default.xml` | 1 each | - **Key checks in code**, for example: - `slfloaterphotostudio.cpp`: Ctrl+Z, Ctrl+Y, Ctrl+Shift+Z, Ctrl+F - `slpanelshapeeditor.cpp`: Ctrl+F - `slchatbar.cpp`: Ctrl+Shift - `llviewerwindow.cpp`: Esc, Tab / Ctrl+Tab, the mouselook key, Ctrl/Alt+Up/Down A full sweep is part of this ticket. ## Scope 1. **Menu shortcuts:** list every menu item that has a `shortcut=` in the Controls panel (grouped by menu). The user can rebind or clear it. The default comes from the XUI. - Store overrides with the other bindings (same file/format as the key_bindings user override). - Apply them to the menu items at startup and live on change, so menu labels show the current accelerator. 2. **Viewer-global hard-coded keys** (llviewerwindow etc.): move them into named actions that the Controls panel can rebind. 3. **Floater-local editing keys** (undo/redo/find inside a floater): these may stay standard (Ctrl+Z/Y/F), but list them as rebindable actions where reasonable. At minimum, document them in the panel. 4. **Conflict detection:** binding a key already used by another action (in the same mode) warns and offers to swap or clear the other binding. 5. **Reset:** reset a single binding or all bindings to defaults. 6. **New features:** any new shortcut must register as a bindable action. Add a check (test or CI script) that fails on a `shortcut=` or a raw key comparison that isn't registered. ## Acceptance - `Ctrl+Shift+F` (Freeze World) can be rebound and cleared in Preferences → Controls, and the new key works immediately. - Every `shortcut=` in the menu XUI appears in the Controls panel. - Rebinds survive a restart, and the menu shows the rebound accelerator. - Conflicts are reported. Reset to default works per-binding and globally.
sky_line added this to the Slipstream project 2026-10-19 08:41:06 +00:00
sky_line referenced this issue from a commit 2026-10-21 02:45:33 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sky_line/Slipstream#863
No description provided.