Replies: 6 comments
-
|
When using Related Chromium issue: issues.chromium.org/issues/40880986 You can create an artificial keyup event by waiting a certain amount of time after the last keydown event. The only caveat is that different people will have different repeat rates in their operating systems. |
Beta Was this translation helpful? Give feedback.
-
|
@whiteyebrw I see, thank you for the quick reply and suggestions! |
Beta Was this translation helpful? Give feedback.
-
|
Looks like there’s nothing we can do about it :( |
Beta Was this translation helpful? Give feedback.
-
|
Hi, As far as I can see
https://w3c.github.io/uievents/tools/key-event-viewer.html
|
Beta Was this translation helpful? Give feedback.
-
|
Hi @laygir, You have to hold meta later, like hold 'a' after releasing 'a' and you won't see the event 'keyup' for 'a'. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @whiteyebrw Thank you for the detail! I see the issue now. I came here because I wanted to use I ended up doing the following, which works as I expected, for instance holding meta and shift and only releasing and pressing const handleSideBarToggleKeyPress = (event) => {
if (event.code === 'KeyS' && event.metaKey && event.shiftKey) {
event.preventDefault();
isSideBarOpen.value = !isSideBarOpen.value;
}
};
onMounted(() => {
document.addEventListener('keydown', handleSideBarToggleKeyPress);
});
onUnmounted(() => {
document.removeEventListener('keydown', handleSideBarToggleKeyPress);
});(Sorry for hijacking the issue with my specific use case) |
Beta Was this translation helpful? Give feedback.


Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
When performing the following sequence:
The
currentvariable isn't updated properly.I would expect to only see
Cmd. Instead, it still showsCmd+AIn the screenshot below, I am only holding
Cmd.Ais not pressed anymore.Reproduction
https://vueuse.org/core/useMagicKeys/
System Info
System: OS: macOS 15.5 CPU: (11) arm64 Apple M3 Pro Memory: 131.73 MB / 18.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 23.11.0 - /opt/homebrew/bin/node Yarn: 1.22.22 - /opt/homebrew/bin/yarn npm: 10.9.2 - /opt/homebrew/bin/npm pnpm: 10.10.0 - /opt/homebrew/bin/pnpm bun: 1.2.10 - /opt/homebrew/bin/bun Browsers: Chrome: 137.0.7151.68 Safari: 18.5Used Package Manager
pnpm
Validations
Beta Was this translation helpful? Give feedback.
All reactions