keyreleased() might be have a bug.

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

keyreleased() might be have a bug.

Pixelapp
I'm getting this problem:

http://stackoverflow.com/questions/1736828/how-to-stop-repeated-keypressed-keyreleased-events-in-swing

, but on windows. It happens in the import com.jogamp.newt.event.KeyListener specifically.

Is this a JOGL problem, or a Java problem? Anyone having the same problem?
Reply | Threaded
Open this post in threaded view
|

Re: keyreleased() might be have a bug.

gouessej
Administrator
Hi

It's not a problem, there are known differences in the way of handling key events between Windows and GNU Linux and Java doesn't try to hide it in this particular case. Please try to use InputEvent.isAutoRepeat() in order to ignore the annoying repeated keys both under Windows and GNU Linux.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: keyreleased() might be have a bug.

Pixelapp
Seriously Julien you are like a master mind, or something.
Reply | Threaded
Open this post in threaded view
|

Re: keyreleased() might be have a bug.

gouessej
Administrator
Pixelapp wrote
Seriously Julien you are like a master mind, or something.
Thanks. As far as I know, under Windows, only key pressed events are repeated. Under GNU Linux, both key released events and key pressed events are repeated (default behaviour of Xserver, can be disabled on command line). When you call InputEvent.isAutoRepeat(), you can detect and ignore these events, then it's like you only get a single key pressed event, a single key released event and a single key typed event when you press and release a key, this is exactly what you want, isn't it? It reminds me that I don't use that correctly in Ardor3D.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: keyreleased() might be have a bug.

Pixelapp
I tested it and it shows repeated key releases and repeated key presses (both) in windows. I have not tested on Linux, but I hear it is the same case: repeated key presses and repeated key releases.
Reply | Threaded
Open this post in threaded view
|

Re: keyreleased() might be have a bug.

gouessej
Administrator
Pixelapp wrote
I tested it and it shows repeated key releases and repeated key presses (both) in windows. I have not tested on Linux, but I hear it is the same case: repeated key presses and repeated key releases.
What do you mean? Does InputEvent.isAutoRepeat() return true for repeated key releases and repeated key presses under windows as expected?
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: keyreleased() might be have a bug.

Sven Gothel
Administrator
On 12/01/2012 09:49 AM, gouessej [via jogamp] wrote:
>     Pixelapp wrote
>     I tested it and it shows repeated key releases and repeated key presses
>     (both) in windows. I have not tested on Linux, but I hear it is the same
>     case: repeated key presses and repeated key releases.
>
> What do you mean? Does InputEvent.isAutoRepeat() return true for repeated key
> releases and repeated key presses under windows as expected?

Just a note: For NEWT key repeat, see here:
<http://forum.jogamp.org/Issue-NEWT-keyboard-keys-automatically-released-when-repeated-tp4027173p4027176.html>

~Sven


signature.asc (909 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: keyreleased() might be have a bug.

gouessej
Administrator
It works very well in TUER. I just skip these events instead of passing them to the poller.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: keyreleased() might be have a bug.

Pixelapp
In reply to this post by gouessej
InputEvent.isAutoRepeat() works fine. Don't worry about that.

What I'm saying is that if you DON'T use InputEvent.isAutoRepeat() then you get repeated key presses and repeated key releases in windows as well. When I tested, I got repeated key releases and repeated key presses in Windows.