Adjust the values for the initial key delay and the key repeat delay. The initial key delay is the time between pressing the key for the first time and the second key press event. The key repeat delay is the time between key events after the second key event.
Just a quick test to simulate the standard keyboard delay within a forever loop. I wasn't sure whether people might find this useful so I decided I'd share it here :) This system can support any amount of keys, although the events of only one key at a time can be recorded - if I press both the left and right arrow keys I will only get key events for the left arrow.