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

Function keyDownHandler

assets/js/breakout.js:44–51  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

42
43
44function keyDownHandler(e) {
45 if(e.key == "Right" || e.key == "ArrowRight") {
46 rightPressed = true;
47 }
48 else if(e.key == "Left" || e.key == "ArrowLeft") {
49 leftPressed = true;
50 }
51}
52
53function keyUpHandler(e) {
54 if(e.key == "Right" || e.key == "ArrowRight") {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected