Key repeat logic

Makes it easier to make fine-tuned adjustments.

Needs to be refactored into an input class