Closed jotaen closed 3 years ago
Ah good catch. This is a simple fix:
I think it should just be code="Space"
.
We used to send codes based on numeric keycodes rather than string keycodes, and it looks like I missed the space bar key when I switched over:
Ah terrific! What’s your preference regarding the history tile? Space
or
?
Oh sorry, Space
is my preference for the key history.
(I’ll take this, but waiting for https://github.com/tiny-pilot/tinypilot/pull/731 to avoid conflicts.)
On a scale from 1 to 10, how important is the Space
vs. ` for us? The keystroke history [relies on
KeyboardEvent.keyfor the display value, not on
KeyboardEvent.code](https://github.com/tiny-pilot/tinypilot/blob/d3d15d5cbb631ace321a399e50314a14fd975b33/app/static/js/app.js#L96) (which we have the canonicalize-function for). So unfortunately we’d need to introduce a dedicated check for it somewhere. It’s not super bad of course (probably like 3 lines of code for an
if (evt.key === " ") return "Space";`) but for me it wouldn’t be worth it.
Yeah, like a 3/10 importance. We can punt on it.
👍 I think so too. We can still do it later, but I initially thought it was an easy win which we can make happen without new special cases.
When I press the “space” key on the virtual (on-screen) keyboard, it sends over keycode
32
which the backend claims to be unrecognized. When pressing the space key on my real keyboard, it sends codeSpace
.They are also displayed differently then in the key history. I’m not sure, though, which one I like better there, but I tend to favour the latter (
Space
).I’ve tested the entire virtual keyboard again, the space key seems to be the only one broken.