Skip to content

Fixes issue #6727 : Back to default WASD centered keybinds#8124

Draft
Seekawan wants to merge 1 commit intoMegaMek:mainfrom
Seekawan:Issue-#6727
Draft

Fixes issue #6727 : Back to default WASD centered keybinds#8124
Seekawan wants to merge 1 commit intoMegaMek:mainfrom
Seekawan:Issue-#6727

Conversation

@Seekawan
Copy link
Copy Markdown

Fixes #6727

Mainly to bring back the key binds to the documented default keybinds.
For instance in current version next weapon is down instead of E.

Also this is a question, is that intended to enable a more balanced keyboard ?

In this pull request keyboard is following a classic "mouse in right hand" layout centered on the WASD.

Please give me any advice for the advancement of that request

In line with /doc/Default Key Binds.txt
@Seekawan Seekawan changed the title Issue #6727 Fixes issue #6727 : Back to default WASD centered keybinds Mar 24, 2026
@HammerGS HammerGS requested a review from Copilot March 24, 2026 18:21
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 29.90%. Comparing base (ac2b8bc) to head (4c7e83a).
⚠️ Report is 28 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8124      +/-   ##
============================================
- Coverage     29.91%   29.90%   -0.02%     
+ Complexity    17383    17364      -19     
============================================
  Files          3173     3173              
  Lines        307461   307480      +19     
  Branches      53751    53752       +1     
============================================
- Hits          91985    91954      -31     
- Misses       205890   205940      +50     
  Partials       9586     9586              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates MegaMek’s shipped default keybind configuration to restore a more “WASD-centered” layout (per issue #6727), primarily adjusting weapon/unit/target cycling defaults.

Changes:

  • Rebinds weapon cycling from arrow keys to Q/E.
  • Rebinds unit and target cycling to nearby letter keys (e.g., Shift+Q/E, Z/C and modifier variants).
  • Adjusts several other defaults (chat key, artillery deploy zone, unit display tabs, modes, zoom, movement envelope).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +424 to +426
<command>movementEnvelope</command> <!-- R -->
<keyCode>82</keyCode>
<modifier>0</modifier>
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

movementEnvelope is now bound to R (82, modifier 0), but fieldOfFire is also bound to R right below. These are CommonMenuBar accelerators, so one of these actions will be unreachable (or the behavior will depend on registration order). Pick a different default for one of them (e.g., keep movementEnvelope on Ctrl+Q as in KeyCommandBind defaults).

Suggested change
<command>movementEnvelope</command> <!-- R -->
<keyCode>82</keyCode>
<modifier>0</modifier>
<command>movementEnvelope</command> <!-- Ctrl+Q -->
<keyCode>81</keyCode>
<modifier>128</modifier>

Copilot uses AI. Check for mistakes.
Comment on lines +130 to 134
<command>nextTarget</command> <!-- C -->
<keyCode>67</keyCode>
<modifier>0</modifier>
<isRepeatable>false</isRepeatable>
</KeyBind>
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nextTarget is rebound to C, but sensorRange already uses C as a CommonMenuBar accelerator. Because non-menu binds are handled by the global KeyEventDispatcher (and consume the event), this will effectively disable the sensorRange shortcut by default. Consider choosing a different key for nextTarget or moving sensorRange off C.

Copilot uses AI. Check for mistakes.
Comment on lines +137 to +138
<command>prevTarget</command> <!-- Z -->
<keyCode>90</keyCode>
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prevTarget is rebound to Z, but zoomOverviewToggle is also bound to Z (CommonMenuBar accelerator). Since prevTarget is handled by the global key dispatcher, it will consume Z and prevent the zoom overview toggle accelerator from firing. One of these defaults needs to move to avoid making zoomOverviewToggle unreachable.

Suggested change
<command>prevTarget</command> <!-- Z -->
<keyCode>90</keyCode>
<command>prevTarget</command> <!-- X -->
<keyCode>88</keyCode>

Copilot uses AI. Check for mistakes.
Comment on lines +529 to 531
<command>zoomIn</command> <!-- Plus -->
<keyCode>521</keyCode>
<modifier>0</modifier>
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

zoomIn is changed from NumPad + (VK_ADD/107) to Plus with keyCode 521 and no Shift modifier. On many layouts, the + key is produced as Shift+= (VK_EQUALS) rather than VK_PLUS, so this default may not work consistently across platforms/layouts. Consider keeping VK_ADD, or using the actual keyCode/modifier pair produced by '+' on common layouts (e.g., VK_EQUALS + Shift).

Suggested change
<command>zoomIn</command> <!-- Plus -->
<keyCode>521</keyCode>
<modifier>0</modifier>
<command>zoomIn</command> <!-- Shift+= (Plus) -->
<keyCode>61</keyCode>
<modifier>64</modifier>

Copilot uses AI. Check for mistakes.
Comment on lines +32 to 35
<command>toggleChat</command> <!-- Backquote -->
<keyCode>192</keyCode>
<modifier>0</modifier>
<isRepeatable>false</isRepeatable>
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

toggleChat is changed from Enter (10) to Backquote (192). This diverges from the built-in default in KeyCommandBind (VK_ENTER) and is likely to surprise users who expect Enter to open chat. If the intent is only to restore the documented weapon/target cycling defaults (issue #6727), consider keeping chat on Enter.

Copilot uses AI. Check for mistakes.
Comment on lines +291 to 302
<command>udWeapons</command> <!-- F5 -->
<keyCode>116</keyCode>
<modifier>0</modifier>
<isRepeatable>false</isRepeatable>
</KeyBind>

<KeyBind>
<command>udSystems</command> <!-- F5 -->
<keyCode>116</keyCode>
<command>udSystems</command> <!-- F4 -->
<keyCode>115</keyCode>
<modifier>0</modifier>
<isRepeatable>false</isRepeatable>
</KeyBind>
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

udWeapons/udSystems are swapped from the existing defaults (Weapons=F4, Systems=F5 per KeyCommandBind). If the goal is to revert to documented defaults, this swap likely goes the wrong direction and will break muscle memory for the unit display tabs. Consider keeping Weapons on F4 and Systems on F5 unless there’s a specific rationale.

Copilot uses AI. Check for mistakes.
@Seekawan
Copy link
Copy Markdown
Author

So about the conflicts I followed what was written in /doc/Default Key Binds.txt
I think we should discuss in which case where we can keep it and in which a separate key should be used

@kuronekochomusuke
Copy link
Copy Markdown
Collaborator

when updating key binds, you also need to update them in KeyCommandBind.java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[RFE] Funky default keybinds

3 participants