isKeyDown(k?: Key | Key[]): boolean

If certain keys are currently down.
// equivalent to the calling bean.move() in an onKeyDown("left")
onUpdate(() => {
    if (isKeyDown("left")) {
        bean.move(-SPEED, 0)
    }
})

sincev3001.0

kaplay logo