Fix bug where repeated key events would lag other events