API Docs for: 1.2.7
Show:

kd Class

Defined in: dist/keydrown.js:367

Item Index

Methods

Methods

run

(
  • handler
)

A basic run loop. handler gets called approximately 60 times a second.

Parameters:

  • handler Function(number, number)

    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.

stop

()

Cancels the loop created by run.

tick

()

Evaluate which keys are held down and invoke their handler functions.