Login  Register

keyReleased keyPressed problem

Posted by elect on Oct 08, 2014; 2:39pm
URL: https://forum.jogamp.org/keyReleased-keyPressed-problem-tp4033288.html

Hi people,

so, I am experiencing a strange beviour with the com.jogamp.newt.event.MouseListener

Under some special condition, very hard to explain, I do not get the right event triggering

For example, I want the combination ctrl+o to open the explorer. Most of the time I get this:

keyPressed 17
keyPressed 79

17 is ctrl, 79 o. The println is just at the begin of the corresponding method. I am using a jFrame, that contains a jPanel where I have attached the newtCanvasAwt from my glWindow. I created a class that implement both the key and mouse listener from the com.jogamp.newt.event and I added both to the glWindows throught the corresponding methods addMouse/KeyListener()

Everything fine. But sometimes I get instead this

keyPressed 17
keyReleased 79
keyReleased 17
keyReleased 79

I found this
http://forum.jogamp.org/keyreleased-might-be-have-a-bug-td4027319.html

but it has nothing to do with my case, I also btw experienced keyReleased/KeyPressed if keeping pressed the same button. I inserted a check on the isAutoUpdate() but nothing changed.

Any idea?


Edit: I noticed another thing, when this problem occurs is because previously I didnt get all the keyReleased that I should have obtained

for example

keyPressed 17
List of pressed inputs
ctrl
keyPressed 79
List of pressed inputs
ctrl
o
keyReleased 17
2014.10.08, 16:44:32  [INFORMATION]  Open a project ...
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.
List of pressed inputs
keyPressed 17
List of pressed inputs
ctrl
keyReleased 79
keyReleased 17
keyReleased 79

Here you can see I press first ctrl, then o and then the explorer opens. But there is a problem, I didnt get the o keyReleased before opening the dialog (keyReleased 79). The next time I press again the combination I do not get the o keyPressed, but I get the o keyReleased twice, like the missing keyReleased was somehow queued somewhere and not it gets triggered.. ??