vuejs / devtools-v6

⚙️ Browser devtools extension for debugging Vue.js applications.
https://devtools-v6.vuejs.org/
MIT License
24.68k stars 4.14k forks source link

fix: mac hotkeys (fix #1907) #2115

Closed edikdeisling closed 9 months ago

edikdeisling commented 1 year ago

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 https://github.com/vuejs/devtools/pull/1993


What is the purpose of this pull request?

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