Bug 1092 - Strange behaviour with keyPressed and keyReleased
Summary: Strange behaviour with keyPressed and keyReleased
Status: UNCONFIRMED
Alias: None
Product: Jogl
Classification: JogAmp
Component: core (show other bugs)
Version: 2
Hardware: pc_x86_64 windows
: --- normal
Assignee: Sven Gothel
URL:
Depends on:
Blocks:
 
Reported: 2014-10-09 17:49 CEST by Giuseppe Barbieri
Modified: 2014-10-16 16:14 CEST (History)
1 user (show)

See Also:
Type: ---
SCM Refs:
Workaround: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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