0

I want to register an application wide key listener. I know, that i can register an key listener for a node. But if this node dont have the current focus, the listener is not thrown. In my current application i have an anchorpane on top of this i have an grid pane with different panes and tableviews. So now i want that the user can press "F5" to refresh the current view. But if the focus is on some textfield, the key press is not thrown. Is there a way to register an listener to the whole application?

Steinliiippp
  • 373
  • 4
  • 20
  • Possible duplicate / related question - http://stackoverflow.com/questions/31732583/pass-context-menu-shortcuts-up-from-editing-control How I solved it is by registering a KeyHandler on the root node. – Itai Jan 14 '16 at 11:29
  • Yes thank you. Solved my problem. But it seems that it is a workaround and not an solution, right? – Steinliiippp Jan 14 '16 at 13:59

1 Answers1

0

Possible duplicate / related question - Application wide key listener How I solved it is by registering a KeyHandler on the root node.

Community
  • 1
  • 1
Steinliiippp
  • 373
  • 4
  • 20