I’d like the space key to be globally intercepted in my application, even when a component that reacts to it (such as TextEditor) has focus (this is acceptable for me because my TextEditor components will only accept numbers anyway). Indeed, I’d like the space key to ALWAYS trigger a play/pause transport command for audio playback.
I tried to create a TextEditor subclass and override the keyPressed method to no avail. When doing that, even though I call the base class for all other key events, text input does not work anymore. Furthermore, I would have to do that for every component that acts on a spacekey press, such as buttons…
Is there a way to globally intercept (and stop) key events at the DocumentWindow (or application) level ?
Thanks a lot