MCPcopy Create free account
hub / github.com/DjDeveloperr/deno_desktop / onEvent

Method onEvent

examples/hello_camera.js:16–41  ·  view source on GitHub ↗
(event)

Source from the content-addressed store, hash-verified

14 }
15
16 onEvent(event) {
17 if (event.type === "windowEvent") {
18 event = event.event;
19 if (event.type === "keyboardInput") {
20 const pressed = event.input.state === "pressed";
21
22 switch (event.input.keyCode) {
23 case 57416: // up
24 this.isForwardPressed = pressed;
25 break;
26
27 case 57424: // down
28 this.isBackwardPressed = pressed;
29 break;
30
31 case 57419: // left
32 this.isLeftPressed = pressed;
33 break;
34
35 case 57421: // right
36 this.isRightPressed = pressed;
37 break;
38 }
39 }
40 }
41 }
42
43 /** @param {Camera} camera */
44 updateCamera(camera) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected