(keystroke)
| 67 | |
| 68 | // Send a keystroke message to the backend, and add a key card to the web UI. |
| 69 | function 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 | |
| 87 | function onSocketConnect() { |
| 88 | if (document.getElementById("shutdown-overlay").isShown()) { |
no test coverage detected