A basic run loop.
handler gets called approximately 60 times a second.
The callback function to call on every tick. You likely want to call kd.tick in this function. This callback receives the time elapsed since the previous execution of the callback as the first parameter, and the current time stamp as the second.
Cancels the loop created by run.
Evaluate which keys are held down and invoke their handler functions.