Closed Darky-Lucera closed 4 years ago
Note that with the old code I could move the character around with the direction keys without problem. Now, sometimes, the character keeps moving sometimes after the player releases the keys
You'll need to clarify by showing the output of print(event)
. Repeat keys don't have a KeyUp event.
To prevent lag issues you'll want to minimize or avoid calling the console_flush/context.present
functions inside of the event loop. This is known to build up a long event buffer if the drawing routine is slow and if the window is redrawn for ignored events such as mouse motion.
Oops! It was my fault, in a different point I consumed the event.
Sorry!
When I changed from:
to the new API:
some of the keyboard events are lost.
To reproduce it just get the events and then put this code:
and play with the up key. Some KeyUp (-1) will be lost.
I'm working with Windows 10, python 3.7.8, tcod 11.15.3