JDK-8341560 : Better documentation for KeyCombinations/KeyCodes/KeyEvents
  • Type: Enhancement
  • Component: javafx
  • Sub-Component: window-toolkit
  • Priority: P4
  • Status: New
  • Resolution: Unresolved
  • Submitted: 2024-10-04
  • Updated: 2024-10-04
Related Reports
Relates :  
Relates :  
Relates :  
Description
The documentation for KeyCombinations is both incorrect and sparse. The distinction drawn between KeyCharacterCombination and KeyCodeCombination is wrong. The docs say that one is dependent on the keyboard layout and the other isn't (they both are). There's not much explanation of how KeyCharacterCombinations work and no indication of when a developer should use a KeyCharacterCombination instead of a KeyCodeCombination.

The documentation should also give a brief outline of how KeyCodes are assigned since there's a relationship between these assignments and KeyCodeCombinations. And there are some KeyCodes that should be marked deprecated.

Though it's not related to shortcut processing it wouldn't hurt to mention that on Mac and Linux dead keys are handled using InputMethod events instead of KeyEvents. This has caused confusion in the past.