DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2006
    Posts
    5

    Question 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.

  2. #2
    Join Date
    Dec 2004
    Location
    San Bernardino County, California
    Posts
    1,468
    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

  1. Database Design Help needed
    By Brian Pittman in forum Database
    Replies: 2
    Last Post: 04-29-2007, 08:23 AM
  2. Replies: 0
    Last Post: 09-21-2006, 08:19 AM
  3. Key Board Events.
    By Dan in forum .NET
    Replies: 1
    Last Post: 06-26-2003, 12:27 AM
  4. Replies: 1
    Last Post: 05-03-2002, 04:43 AM
  5. Writing in HKEY_LOCAL_MACHINE...Access is denied
    By Martin in forum VB Classic
    Replies: 22
    Last Post: 12-03-2001, 03:53 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


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


Sponsored Links