Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flush input after each frame refresh #3

Closed
Mikolaj opened this issue Oct 6, 2010 · 1 comment
Closed

Flush input after each frame refresh #3

Mikolaj opened this issue Oct 6, 2010 · 1 comment

Comments

@Mikolaj
Copy link
Member

Mikolaj commented Oct 6, 2010

I hate it when I lean on a key and the next thing I see is "Game Over". Even on the fastest computers, key autorepeat generates commands faster than the game can execute and display. If we can avoid commands with multiple keypresses (except via menus, be them GTK, or ASCII) then we can assume that each keypress is one command and so between consecutive frames, only one keypress should be accepted. Either the last one, with the previous ones ignored, or the first one, with the subsequent keys generating a beep, warning and perhaps canceling the first one, too.

Ideally, it should be all sequential: frame, keypress, frame, keypress. But GTK is highly asynchronous and even the wait for the keys is so and the low-level autorepeat mechanism. Moreover, I like it that window resize or font change in our gtk backend is asynchronous. So probably we have to decide some method of trimming the keypress sequence for each frame.

@Mikolaj Mikolaj mentioned this issue Feb 22, 2012
@Mikolaj
Copy link
Member Author

Mikolaj commented Feb 25, 2012

Instead of ignoring keypresses when there are too many, I will minimize latency so that it's hard to accumulate not yet acted upon keypresses. In particular, any keypress will fast forward all animations. Closing.

@Mikolaj Mikolaj closed this as completed Feb 25, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant