Overv / MineAssemble

A tiny bootable Minecraft clone written partly in x86 assembly
MIT License
1.04k stars 68 forks source link

Keys stick (sometimes) #3

Open Tynach opened 11 years ago

Tynach commented 11 years ago

Sometimes, and it appears to be when I double-tap a key, the key sticks down and causes motion or rotation constantly. However, sometimes it causes rotation in the opposite direction than I tapped. For example, double-tapping the left arrow key will usually cause the player to rotate constantly to the left, but sometimes causes rotation to the right.

I can use this to move/rotate faster and faster by continuing to double-tap, but sometimes I can't get it out of the loop to stand still or move the other direction, since doing it in the opposite direction is just making it still go faster; or the framerate is too slow for me to see which direction it's actually moving/rotating.

Overv commented 11 years ago

This seems to be very dependent on framerate, because it's much harder to reproduce running natively or in VirtualBox. Maybe some sort of input stack should be implemented instead of the key map that is currently used.

Tynach commented 11 years ago

It happens less in Virtualbox, but it still happens in VBox, even when I do it by accident. It might also be when I'm just tapping once, but not holding down the key long enough. I really can't tell.

Overv commented 11 years ago

I'm still not sure what causes this, but I've added code that prevents input from adding up, so you can at least correct the behaviour now.