Login  Register

Re: keyReleased keyPressed problem

Posted by elect on Oct 09, 2014; 7:20am
URL: https://forum.jogamp.org/keyReleased-keyPressed-problem-tp4033288p4033292.html

Sven Gothel wrote
KeyListener ?
Yeah, sorry, I meant the keyListener

Sven Gothel wrote
you mean 'isAutoRepeat()' of NEWT KeyEvent ?

So you are saying, you experience an auto-repeated 'CTRL-O'
from AWT, but the NEWT KeyEvent shows them as being
not auto-repeat?

~Sven
No, isAutoRepeat() was just a little parentesis that changed nothing, I try to be clearer

Take a look to this output

keyPressed 17                                             (keyPressed - ctrl)
List of pressed inputs
ctrl
keyPressed 79                                             (keyPressed - o)
List of pressed inputs
ctrl
o
keyReleased 17                                           (keyReleased - ctrl)
2014.10.08, 16:44:32  [INFORMATION]  Open a project ...                                            (the fileChooser is opened)
2014.10.08, 16:44:32  [INFORMATION]  Opening file chooser for load.
2014.10.08, 16:44:33  [INFORMATION]  User clicked 'cancel' in file chooser dialog.          (I pressed esc to close it, then I will press again ctrl+o combination)
List of pressed inputs
keyPressed 17                                             (keyPressed - ctrl)
List of pressed inputs
ctrl
keyReleased 79                                           (keyReleased - o)
keyReleased 17                                           (keyReleased - ctrl)
keyReleased 79                                           (keyReleased - o)

As you can see, before the fileChooser is opened, a keyReleased-o is missing. When I press again the combination, only the keyPressed-ctrl will be triggered, no keyPressed-o. Moreover there is a double keyReleased-o.
The printlns are the first one to be called

@Override
    public synchronized void keyPressed(KeyEvent ke) {
        System.out.println("keyPressed " + ke.getKeyCode());

So there is nothing blocking them, if you dont see it, they are not triggered..