Bug 1092

Summary: Strange behaviour with keyPressed and keyReleased
Product: [JogAmp] Jogl Reporter: Giuseppe Barbieri <elect86>
Component: coreAssignee: Sven Gothel <sgothel>
Status: UNCONFIRMED ---    
Severity: normal CC: sgothel
Priority: ---    
Version: 2   
Hardware: pc_x86_64   
OS: windows   
Type: --- SCM Refs:
Workaround: ---

Description Giuseppe Barbieri 2014-10-09 17:49:04 CEST
Sometimes I experience a strange behaviour.

I created a simple test scenario for this: 
https://github.com/elect86/KeyListenerScenario

Play with the ctrl+o combination to open the jFileChooser.

Most of time it works as supposed:

keyPressed 17
keyPressed 79
fileChooser opens
fileChooser closed

That is the ctrl-keyPressed is triggered, then the o-keyPressed, fileChooser opens and then I close it.

Sometimes instead I get this

keyReleased 79
keyReleased 17
keyReleased 79

That is no keyPressed, only keyReleased, one of them doubled.

In order to make it happen try to press them together and then keep them pressed for a while and then release the ctrl.
Comment 1 Sven Gothel 2014-10-10 11:07:10 CEST
thank you for reporting, if anyhow possible,
please add a small unit test.

you may copy one of ours here,
as we do have a few NEWT KeyEvent tests available.

if that is not possible, a small standalone demo
would do it.
Comment 2 Giuseppe Barbieri 2014-10-16 16:14:51 CEST
(In reply to comment #1)
> thank you for reporting, if anyhow possible,
> please add a small unit test.
> 
> you may copy one of ours here,
> as we do have a few NEWT KeyEvent tests available.
> 
> if that is not possible, a small standalone demo
> would do it.

(In reply to comment #1)
> thank you for reporting, if anyhow possible,
> please add a small unit test.
> 
> you may copy one of ours here,
> as we do have a few NEWT KeyEvent tests available.
> 
> if that is not possible, a small standalone demo
> would do it.


The small unit test is at the github link