Skip to content

Show the bound key in key binding appendices - #255

Merged
rubensworks merged 1 commit into
master-1.21-ltsfrom
fix-keybinding-appendix-key-name
Oct 18, 2026
Merged

rubensworks merged 1 commit into
master-1.21-ltsfrom
fix-keybinding-appendix-key-name

Conversation

@rubensworks

Copy link
Copy Markdown
Member

The keybinding info book appendix drew L10NHelpers.localize(keyBinding.saveString()). That only gives readable text for keys that have a lang entry, such as / or the arrow keys. Letter keys showed the raw key.keyboard.z, and the key modifier was never shown, so a Ctrl+Z binding showed up as key.keyboard.z.

It now uses keyBinding.getTranslatedKeyMessage(), which is the same text the Controls screen shows (for example CTRL + Z or ALT + Up Arrow). It also reflects rebinding.

Found while adding a shortcuts section to the Integrated Scripting info book (CyclopsMC/IntegratedScripting#79).

Validation

  • Published this branch to Maven Local and ran Integrated Scripting's dev client against it. Before: key.keyboard.z, key.keyboard.y, key.keyboard.f, key.keyboard.g, with no modifiers. After: CTRL + Z, CTRL + Y, CTRL + F, CTRL + G, CTRL + /, ALT + Up Arrow, ALT + Down Arrow.
  • ./gradlew build and ./gradlew :loader-neoforge:runGameTestServer pass.

The same code is likely on the newer master-* branches too, so it should carry over with the usual upmerge.


Generated by Claude Code

The appendix localized the key's save string, which shows a raw
translation key such as "key.keyboard.z" for letter keys, and left out
the key modifier. It now shows the same text as the Controls screen,
such as "CTRL + Z".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018MRyTdV3fSV5Q5NPGep4q9
@sonarqubecloud

Copy link
Copy Markdown

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 26.786%. remained the same — fix-keybinding-appendix-key-name into master-1.21-lts

@rubensworks
rubensworks merged commit 3e43a02 into master-1.21-lts Oct 18, 2026
7 checks passed
@rubensworks
rubensworks deleted the fix-keybinding-appendix-key-name branch October 18, 2026 12:17
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.

3 participants