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

fix: mac hotkeys (fix #1907) #2115

Merged
merged 1 commit into from Feb 4, 2024
Merged

fix: mac hotkeys (fix #1907) #2115

merged 1 commit into from Feb 4, 2024

Conversation

edikdeisling
Copy link
Contributor

Description

PR about hotkeys from here
image

On Mac "option" key modifies the resulted event.key value (s becomes ß) that's why check event.key === 's' doesn't work.
According to mdn's KeyboardEvent: code article we can't fix the bug with event.code === 'KeyS' because on different keyboard layouts symbol will be different.

For example, the code returned is "KeyQ" for the Q key on a QWERTY layout keyboard,
but the same code value also represents the ' key on Dvorak keyboards and the A key
on AZERTY keyboards. 

That makes it impossible to use the value of code to determine what the name of the 
key is to users if they're not using an anticipated keyboard layout.

So I just added the resulting keys to the whitelist.

Additional context

There is another old PR but with a different fix
#1993


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the Commit Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).

@Akryum Akryum merged commit fc78f5a into vuejs:main Feb 4, 2024
4 of 5 checks passed
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

Successfully merging this pull request may close these issues.

None yet

2 participants