Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Java KeyEvents in Linux  RSS feed

 
Drew Lane
Ranch Hand
Posts: 296
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm having a problem with keyevents. I'm getting extraneous keyReleased events when a key is held down using Sun Java 1.3 on Linux.
When run on a Windows workstation with Sun JDK, pressing and holding a key (for instance space) prints the following sequence of event:

But when run on Red Hat Linux 7.2 with Sun JDK 1.3, I get extraneous KEY_RELEASED events, even if the key is not released!


This behavior is really making it impossible to do certain game programming on Linux where you need to know when the user released the key.
For example, if I wanted to create a golf game and in order to "hit" the ball the player holds the key down and then releases it as the club swings around there would be no way to know when the player actually released the key because release events are being trigger when they shouldn't be. (?)
Any explanation or a workaround?
Thanks,
Drew
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looks like Sun has a Bug Report open on this issue...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!