16
Window / Clear Keyboard Events in buffer
« on: October 07, 2013, 02:43:08 pm »
Hello everyone,
I'm trying to replicate the functionality of FlushConsoleInputBuffer (for Console apps), and SDL_PeekEvent (with SDL_GETEVENT). They both give the ability to remove specific events from the queue.
This is useful is cases where the time it takes to process an event is much slower than the time it takes for the user to create an event. Example: Scrolling down a list with the keyboard arrows, if the user presses the keyboard too often - or through keyboard repeat - then the list will try to continue to scroll when it reaches the end, and you have to wait until all the events are done before you can do anything. In this case I'd like to clear the keyboard event buffer so that when the end of the list is reached the user can continue producing events.
I don't think I saw the ability to do this in SFML? Are there plans to introduce it? Are there any ways that I can do this?
Thanks guys,
Marc
I'm trying to replicate the functionality of FlushConsoleInputBuffer (for Console apps), and SDL_PeekEvent (with SDL_GETEVENT). They both give the ability to remove specific events from the queue.
This is useful is cases where the time it takes to process an event is much slower than the time it takes for the user to create an event. Example: Scrolling down a list with the keyboard arrows, if the user presses the keyboard too often - or through keyboard repeat - then the list will try to continue to scroll when it reaches the end, and you have to wait until all the events are done before you can do anything. In this case I'd like to clear the keyboard event buffer so that when the end of the list is reached the user can continue producing events.
I don't think I saw the ability to do this in SFML? Are there plans to introduce it? Are there any ways that I can do this?
Thanks guys,
Marc