Discarding key pressed events.



Hello,

in my application I have some key handlers which receive input from the user. When the user press a key, a task has to be executed: this task could require a tiny time slice or a longer one. The problem is that if the user hold pressed a key and the relative task takes a lot of time to be executed, my application will be flooded of key pressed events. I would like to avoid the situation where I receive a lot of "key press" events, which force my application to execute a long time consuming task each time the event is received, and then the application is stuck until all the events are "eaten".

How to avoid this? maybe i could delete the keys' event from the events queue? Any help?

Greetings,
Luca



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]