Skip to content

Commit

Permalink
fixup! fix(useHotKey): respect press of MacOS Cmd key as Ctrl key
Browse files Browse the repository at this point in the history
Signed-off-by: Antreesy <[email protected]>
  • Loading branch information
Antreesy committed Aug 28, 2024
1 parent 64033e9 commit 359468b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/composables/useHotKey/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ function shouldIgnoreEvent(event) {
}

const eventHandler = (callback, options) => (event) => {
if (isMac ? (!!options.ctrl !== event.metaKey) : (!!options.ctrl !== event.ctrlKey)) {
const ctrlKeyPressed = isMac ? event.metaKey : event.ctrlKey
if (!!options.ctrl !== ctrlKeyPressed) {
// Ctrl is required and not pressed, or the opposite
return
} else if (!!options.alt !== event.altKey) {
Expand Down

0 comments on commit 359468b

Please sign in to comment.