Skip to content

Conversation

@y5nw
Copy link
Contributor

@y5nw y5nw commented Jan 7, 2026

The order of the commits is more or less outlined in #16750 (comment). I chose to not open 4 pull requests as some commits (particularly the second commit) introduce changes that are obsoleted/removed in later ones.

  • First commit: Implement secondary keybindings [UI Proposal 2] #16803 (comment)
  • Second commit: Adjustments, among other things:
    • KeyPress::scancode is renamed to KeyPress::value
    • KeyPress::getType() is introduced to get the type of input
    • Calls to std::variant-related functions and methods use indices (based on getType()) instead of types; this makes it easier to infer the type of input.
  • Third commit: Adjusted version of Decouple TouchControls from keybinding settings #16215; changes from that PR are split between this commit and the previous commit to ease reviewing
  • Fourth commit: Fixes Cannot bind any game controls to mouse buttons 6 and above #16750
    • The EKEY_CODE variant is removed from KeyPress as it is no longer needed
    • I have chosen to not merge LMB/MMB/RMB button events as a lot of (GUI-related) code have different paths based on the specific mouse button while the in-game input handler is practically the only place with a combined code path for all mouse buttons; in other words, there is IMO little to gain from merging LMB/MMB/RMB events.
    • The keycode migration is only handled in Lua. This allows differentiating mouse button migrations from pre-5.12 keycode migrations, the former of which does not require the user to reconfigure keybindings.

To do

This PR is a Work in Progress.

How to test

  • First/second commits: 🤷
  • Third commit: Unbind keys from the keybinding menu and observe that touchscreen buttons continue to work
  • Fourth commit:
    • Bind actions to mouse keys (particularly X1, X2, and beyond) and observe that these continue to work
    • Observe that settings with older mouse buttons (e.g. keymap_autoforward = KEY_MBUTTON) are automatically migrated (i.e. continue to work), and the user is not informed about the migration.

@y5nw y5nw added Maintenance Tasks to keep the codebase and related parts in order, including architectural improvements @ Client / Controls / Input labels Jan 7, 2026
@y5nw y5nw changed the title [no sq] Improvements to the input handler [no sq] Various improvements to the input handler Jan 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

@ Client / Controls / Input Maintenance Tasks to keep the codebase and related parts in order, including architectural improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot bind any game controls to mouse buttons 6 and above

1 participant