Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling unidentified/death keys in the keyboard history UI #1747

Open
jotaen4tinypilot opened this issue Mar 5, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@jotaen4tinypilot
Copy link
Contributor

I noticed one quirk in the UI, regarding the keypress history in the status bar. Note: this only affects the UI, not the backend or HID interface!

When the client machine is configured to use a keyboard layout that doesn’t provide a mapping for certain keys or key combinations, the keyboard history shows inconsistent results across browsers. From the view point of the target machine, however, things work as expected. So this issue is specific to using non-EN-US keyboard layouts.

I tested this on a MacOS machine with a customised keyboard layout, which doesn’t define a mapping for the alt+L key combination. So pressing alt+L on the client machine wouldn’t produce any character on the client machine itself. However, on the target machine, the alt+L combination may be well-defined, e.g. if the target machine uses a German keyboard layout where alt+L maps to the @ character. In this scenario, TinyPilot would forward the alt+L combination to the target machine, and produce the @ there.

In the TinyPilot’s web UI, however, I see these results in the status bar:

As stated in the documentation, the key property of the KeyboardEvent object may be Unidentified or Dead:

  • If the KeyboardEvent represents the press of a dead key, the key value must be "Dead".
  • If the key cannot be identified, the returned value is Unidentified.

For the keyboard history, we rely on that key property, which is why we see this.

@jotaen4tinypilot jotaen4tinypilot added the bug Something isn't working label Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant