MCPcopy Index your code
hub / github.com/tiny-pilot/tinypilot / processKeystroke

Function processKeystroke

app/static/js/app.js:69–85  ·  view source on GitHub ↗
(keystroke)

Source from the content-addressed store, hash-verified

67
68// Send a keystroke message to the backend, and add a key card to the web UI.
69function processKeystroke(keystroke) {
70 // On Android, when the user is typing with autocomplete enabled, the browser
71 // sends dummy keydown events with a keycode of 229. Ignore these events, as
72 // there's no way to map it to a real key.
73 if (keystroke.keyCode === 229) {
74 return;
75 }
76 const keystrokeHistoryEvent = keystrokeHistory.push(keystroke.key);
77 const result = sendKeystroke(socket, keystroke);
78 result
79 .then(() => {
80 keystrokeHistoryEvent.status = "succeeded";
81 })
82 .catch(() => {
83 keystrokeHistoryEvent.status = "failed";
84 });
85}
86
87function onSocketConnect() {
88 if (document.getElementById("shutdown-overlay").isShown()) {

Callers 2

onKeyDownFunction · 0.85
app.jsFile · 0.85

Calls 1

sendKeystrokeFunction · 0.90

Tested by

no test coverage detected