fogleman / Craft

A simple Minecraft clone written in C using modern OpenGL (shaders).
http://www.michaelfogleman.com/craft/
MIT License
10.39k stars 1.39k forks source link

Keyboard buffering causes control lag #230

Open hosford42 opened 5 years ago

hosford42 commented 5 years ago

When holding down a key, the keyboard buffer fills, causing the associated behavior to continue afterward for some time. For example, if I hold down the W key for a few seconds, the character continues to move forward for some time after releasing the key. This makes the game very difficult to play. Using keyboard events (key down/key up) instead of buffered keyboard input would eliminate this issue.

twetzel59 commented 4 years ago

As I understand, you are suggesting using the GLFW event delivery to track keyup/keydown, and storing the state somewhere, probably in the Model struct?