-
discarding unperformed key events
I am currently writing a 2D RPG game engine in java and I am having a problem with the key press event. The problem occurs when the user holds down a key and generates input faster than the display can update. This results in the user controlled character moving after the user has released the key. I was wondering if there was a way to discard all the key events that haven't happened yet when the key is released. If that isn't possible is there a way to not have key events queued in the first place so that they are either proccessed as they come or not at all? I am using the Full Screen Exclusive API to do my drawing.
-
One way to handle this is to have an event buffer with a limited capacity. For an idea of how to implement it, take a look at the EventQueue class in the API documentation.
Similar Threads
-
By Brian Pittman in forum Database
Replies: 2
Last Post: 04-29-2007, 08:23 AM
-
By sachinkataria in forum Java
Replies: 0
Last Post: 09-21-2006, 08:19 AM
-
Replies: 1
Last Post: 06-26-2003, 12:27 AM
-
Replies: 1
Last Post: 05-03-2002, 04:43 AM
-
By Martin in forum VB Classic
Replies: 22
Last Post: 12-03-2001, 03:53 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks