Fixes issue #6727 : Back to default WASD centered keybinds#8124
Fixes issue #6727 : Back to default WASD centered keybinds#8124Seekawan wants to merge 1 commit intoMegaMek:mainfrom
Conversation
In line with /doc/Default Key Binds.txt
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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/Cand 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.
| <command>movementEnvelope</command> <!-- R --> | ||
| <keyCode>82</keyCode> | ||
| <modifier>0</modifier> |
There was a problem hiding this comment.
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).
| <command>movementEnvelope</command> <!-- R --> | |
| <keyCode>82</keyCode> | |
| <modifier>0</modifier> | |
| <command>movementEnvelope</command> <!-- Ctrl+Q --> | |
| <keyCode>81</keyCode> | |
| <modifier>128</modifier> |
| <command>nextTarget</command> <!-- C --> | ||
| <keyCode>67</keyCode> | ||
| <modifier>0</modifier> | ||
| <isRepeatable>false</isRepeatable> | ||
| </KeyBind> |
There was a problem hiding this comment.
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.
| <command>prevTarget</command> <!-- Z --> | ||
| <keyCode>90</keyCode> |
There was a problem hiding this comment.
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.
| <command>prevTarget</command> <!-- Z --> | |
| <keyCode>90</keyCode> | |
| <command>prevTarget</command> <!-- X --> | |
| <keyCode>88</keyCode> |
| <command>zoomIn</command> <!-- Plus --> | ||
| <keyCode>521</keyCode> | ||
| <modifier>0</modifier> |
There was a problem hiding this comment.
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).
| <command>zoomIn</command> <!-- Plus --> | |
| <keyCode>521</keyCode> | |
| <modifier>0</modifier> | |
| <command>zoomIn</command> <!-- Shift+= (Plus) --> | |
| <keyCode>61</keyCode> | |
| <modifier>64</modifier> |
| <command>toggleChat</command> <!-- Backquote --> | ||
| <keyCode>192</keyCode> | ||
| <modifier>0</modifier> | ||
| <isRepeatable>false</isRepeatable> |
There was a problem hiding this comment.
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.
| <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> |
There was a problem hiding this comment.
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.
|
So about the conflicts I followed what was written in /doc/Default Key Binds.txt |
|
when updating key binds, you also need to update them in KeyCommandBind.java |
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