DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2006

    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
    San Bernardino County, California
    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

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
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

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