I'd like to map the spacebar key event to an application level Accelerator but it seems that the Buttons on my scenegraph automatically handle and consume that keycode. Can I disable this default behavior?
From my understanding of the event processing flow, the key stroke begins at the Stage and propagates to the Scene and down my scenegraph to a Button then back up the chain to the Stage again. EventFilters being processed on the way down and the EventHandlers on the way up.
It seems that my Accelerator on the KeyCode.SPACE placed on the Stage never fires because it's on the Handler path (last in line) and the Buttons have all consumed my event by then.
I've successfully achieved a workaround where I just place an EventFilter for the space key on the Stage (now getting first crack at the event) and consuming it there, but that seems like special case code and a defeat for a KeyCombination Accelerator mechanism. Is there a simple way to tell the Buttons to just leave Key Events alone?
(Secondary question of lesser importance)
Buttons possibly consume other keystrokes too? The JavaDoc is a little cryptic here talking about the VK_ENTER and VK_ESC press. Could these possibly refer to the static key codes defined in java.awt.event.KeyEvent? Why use key constants from another toolkit when JavaFX defines perfectly good KeyCodes?