• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Standard key sequences

 
Stefan K Larsson
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am looking for something in JavaFX 8 which corresponds to standard key sequences in Qt which returns standard key combinations depending on the current operating system.

See the corresponding Qt-documentation:
http://qt-project.org/doc/qt-5/qkeysequence.html#standard-shortcuts
http://qt-project.org/doc/qt-5/qkeysequence.html#StandardKey-enum

I have not been able to find anything similar in the JavaFX 8 documentation.
 
John Damien Smith
Ranch Hand
Posts: 287
13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suggest creating a feature request for defining standard key combinations in the JavaFX issue tracker.

That way, when Behaviors are made public they can make use of the standard key combination API.

JavaFX has a behavior system to model platform specific behaviors such as key events and mouse events. The behavior API is currently private and will (likely) be exposed as a public API in a future JavaFX release (after it has undergone, more development, modification and review). The key bindings in the behaviors are the closest thing to the standard key combinations you refer to. You can see how some key bindings are defined in the ListViewBehavior. Many of the standard bindings defined in QT are to do with text input bindings, so the equivalent of those is the TextInputBinding. Be aware that because classes like TextInputBinding are not supported public API, they will be subject to change without notice in future JavaFX versions.

Some common keys like next track, previous track, volume up, volume down, etc, are defined in the existing KeyCombination class.

There is a special KeyCode called SHORTCUT, it is defined as below:

> This common shortcut modifier is a modifier key which is used commonly in shortcuts on the host platform. It is for example control on Windows and meta (command key) on Mac.

In the meantime define your own KeyCombinations for different platforms and switch between them as appropriate, making use of SHORTCUT to make it easier to get expected cross-platform behaviour.
 
Stefan K Larsson
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your insights. I filed an issue in Jira #RT-37936.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic