discarding unperformed key events


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: discarding unperformed key events

  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, 09:23 AM
  2. Replies: 0
    Last Post: 09-21-2006, 09:19 AM
  3. Key Board Events.
    By Dan in forum .NET
    Replies: 1
    Last Post: 06-26-2003, 01:27 AM
  4. Replies: 1
    Last Post: 05-03-2002, 05:43 AM
  5. Writing in HKEY_LOCAL_MACHINE...Access is denied
    By Martin in forum VB Classic
    Replies: 22
    Last Post: 12-03-2001, 04: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
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center