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

Pressing CapsLock in the demo textbox writes "CapsLock" #11

Closed
nico-abram opened this issue Jul 29, 2020 · 4 comments
Closed

Pressing CapsLock in the demo textbox writes "CapsLock" #11

nico-abram opened this issue Jul 29, 2020 · 4 comments

Comments

@nico-abram
Copy link

I decided to test it after I saw capslock made an event shown as Text("CapsLock") in the raw state window while mashing the keyboard

@nico-abram
Copy link
Author

Also happens with Insert

@nico-abram
Copy link
Author

And NumLock

@nico-abram
Copy link
Author

nico-abram commented Jul 29, 2020

And Pause and ScrollLock

EDIT: And ContextMenu

@emilk
Copy link
Owner

emilk commented Jul 30, 2020

Thanks!

This is because when listening to the keydown event, the web sends me the name of the key in the same field as the text they represent. So if you press the F key we get either "f" or "F" (depending on shift/capslock state) and I get "F1" when someone pressed the "F1" key, "CapsLock" when someone pressed the CapsLock key, and so on. This sucks. Maybe there is some other event I should be listening to instead, but reading web/JS docs makes me sad, so I won't dig any deeper at this point.

Instead I'll keep black-listing the names of keys which aren't real text. sigh

Fixed in f693a55

EDIT: this fix has not yet been published to the web demo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants