MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / keyDown

Function keyDown

assets/js/carAvoidanceGame.js:9–12  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

7document.addEventListener('keydown',keyDown);
8document.addEventListener('keyup',keyUp);
9function keyDown(e){
10 e.preventDefault();
11 keys[e.key]=true;
12}
13function keyUp(e){
14 e.preventDefault();
15 keys[e.key]=false;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected