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

Function control

assets/js/2048.js:143–153  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

141
142 //assign functions to keyCodes
143 function control(e) {
144 if (e.keyCode === 37) {
145 keyLeft()
146 } else if (e.keyCode === 38) {
147 keyUp()
148 } else if (e.keyCode === 39) {
149 keyRight()
150 } else if (e.keyCode === 40) {
151 keyDown()
152 }
153 }
154 document.addEventListener('keyup', control)
155
156 function keyRight() {

Callers

nothing calls this directly

Calls 4

keyLeftFunction · 0.85
keyRightFunction · 0.85
keyUpFunction · 0.70
keyDownFunction · 0.70

Tested by

no test coverage detected