• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Standard key sequences

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:

I have not been able to find anything similar in the JavaFX 8 documentation.
Posts: 387
  • 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
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.
    Bookmark Topic Watch Topic
  • New Topic