Re: NewtCanvasAWT + key bindings
Posted by
Sven Gothel on
Dec 29, 2015; 5:23pm
URL: https://forum.jogamp.org/NewtCanvasAWT-key-bindings-tp4035922p4035934.html
On 12/26/2015 11:23 PM, rndfax [via jogamp] wrote:
> Hello, everyone!
>
> I have jogl-2.2.4 on my system and I'm trying to use NewtCanvasAWT with Swing
> components. For my program I need hotkeys. In the example below pressed keys
> do not trigger action if focus is inside NewtCanvasAWT component - i.e. if I
> click somewhere in the window (not in NewtCanvasAWT) and then press key 'w' I
> will see my message "!!!!!!!!", but when I click mouse on NewtCanvasAWT and
> then press key 'w' I don't see anything.
>
> Could you please help me this problem? How to trigger actions when the focus
> is inside NewtCanvasAWT?
If the child NEWT windows (child of the AWT parent)
is focused, events will be delivered and consumed to it.
Hence it is naturally that AWT won't receive those events anymore.
You may want to add a NEWT key event listener
and either triggering your actions from there
or propagating the events to your AWT framework.
~Sven