/* Kit input (v1) - keyboard + touch buttons mapped to actions. From _Tools\Library\web\kit. const input = Kit.input({ keys: { ArrowUp: 'up', w: 'up', ArrowDown: 'down', s: 'down', ArrowLeft: 'left', a: 'left', ArrowRight: 'right', d: 'right', ' ': 'action', p: 'pause', Escape: 'pause', m: 'mute' }, onPress(action, e) {}, // first press only (no key repeat) onRelease(action) {}, }); input.down('left') is it held right now? input.latest(['up','right','down','left']) most recently pressed of these that is still held input.consume('action') true once per press (polling style inside update()) Touch buttons: any element with data-action="left" works like the key (pointer capture, so sliding off the button releases it). Typing into /