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

Hotkeys do not follow local keyboard layout #669

Closed
jweather opened this issue Jul 11, 2023 · 2 comments
Closed

Hotkeys do not follow local keyboard layout #669

jweather opened this issue Jul 11, 2023 · 2 comments

Comments

@jweather
Copy link

  • Set Windows keyboard layout to US/Dvorak for example
  • Ctrl-S and Ctrl-B do not work as expected in Script Editor. Instead they are Ctrl-O and Ctrl-X respectively, ie, they are mapped to key positions rather than letters
  • Bitburner v2.3.1 (1000300)
@jweather
Copy link
Author

jweather commented Jul 11, 2023

if (event.code == "KeyB" && (event.ctrlKey || event.metaKey)) {
is using KeyboardEvent.code=='KeyB' which returns the key position rather than value. KeyboardEvent.key=='b' should behave as expected. You can see the same effect reproduced at https://javascript.info/keyboard-events

keydown key=a code=KeyA
keyup key=a code=KeyA
keydown key=o code=KeyS
keyup key=o code=KeyS
keydown key=e code=KeyD
keyup key=e code=KeyD
keydown key=u code=KeyF
keyup key=u code=KeyF

@d0sboots
Copy link
Collaborator

Duplicate of #420

@d0sboots d0sboots marked this as a duplicate of #420 Jul 11, 2023
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