On Thu, 13 Aug 2026 17:53:35 GMT, Andy Goryachev <[email protected]> wrote:
> Updated `KeyCodeCombination.getDisplayText()` to return "NumPad *" text for
> all numpad keys:
>
>
> Arguments.of("NumPad 0", KeyCode.NUMPAD0),
> Arguments.of("NumPad 1", KeyCode.NUMPAD1),
> Arguments.of("NumPad 2", KeyCode.NUMPAD2),
> Arguments.of("NumPad 3", KeyCode.NUMPAD3),
> Arguments.of("NumPad 4", KeyCode.NUMPAD4),
> Arguments.of("NumPad 5", KeyCode.NUMPAD5),
> Arguments.of("NumPad 6", KeyCode.NUMPAD6),
> Arguments.of("NumPad 7", KeyCode.NUMPAD7),
> Arguments.of("NumPad 8", KeyCode.NUMPAD8),
> Arguments.of("NumPad 9", KeyCode.NUMPAD9),
> Arguments.of("NumPad *", KeyCode.MULTIPLY),
> Arguments.of("NumPad +", KeyCode.ADD),
> Arguments.of("NumPad -", KeyCode.SUBTRACT),
> Arguments.of("NumPad .", KeyCode.DECIMAL),
> Arguments.of("NumPad /", KeyCode.DIVIDE)
>
>
> Added test for numpad and also modified the test case where we have
> platform-specific differences (Backspace, Delete, ...)
>
> NOTE: noticed the auto-generated text shows weird names - "Back Space"
> instead of "Backspace". We might want to double check and fix these as well.
>
> some names are weird, perhaps these should also be fixed:
>
> KeyCode.BACK_SPACE: Back Space
> KeyCode.QUOTEDBL: Quotedbl
> KeyCode.EJECT_TOGGLE: Eject Toggle
> KeyCode.KP_DOWN: Kp Down
> KeyCode.KP_LEFT: Kp Left
> KeyCode.KP_RIGHT: Kp Right
> KeyCode.KP_UP: Kp Up
>
> Also, there is difference in naming certain keys between macOS keyboards and
> the rest of the world:
>
> esc - Esc
> backspace == delete
> return - Enter
> caps lock - Caps Lock
> shift - Shift
>
> The use of symbols for macOS is questionable in my opinion, maybe the
> keyboard have changed since then:
>
> KeyCode.BACK_SPACE: ⌫
> KeyCode.DELETE: ⌦
> KeyCode.ESCAPE: ⎋
>
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK
> Interim AI Policy](https://openjdk.org/legal/ai).
It's uncommon to create menu items with most of these shortcuts so I'm not sure
how much effort we should put into this. But if we're going to clean this up we
should consider doing it all.
To avoid distraction most keyboard shortcut text is as brief as possible. I
would recommend "Num 4" instead of "NumPad 4". For that matter "Page Down"
should be "PgDn", "Escape" just "Esc", and "Back Space" just "Backspace". That
would also align better with what's printed on most keyboards.
You mention the distinction between "esc" and "Esc". Keyboards don't generally
capitalize "esc" but it's still correct to use "Esc" in the menu item text the
same way we write "Ctrl" instead of "ctrl".
The Mac has a long tradition of using only symbols in the shortcut text instead
of spelling out the key's name so it's correct for JavaFX to use ⎋ for escape
even though I don't think that symbol has been printed on any keyboard.
Don't worry about KP_LEFT, KP_RIGHT, KP_UP, or KP_DOWN. They've never been
implemented (even in AWT) and never can be. See
[JDK-8316307](https://bugs.openjdk.org/browse/JDK-8316307).
-------------
PR Review: https://git.openjdk.org/jfx/pull/2257#pullrequestreview-4938934569