You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-07 10:46:24 +03:00
Fix shift-ctrl-click
isOnlyCtrlOrCmdKeyEvent is predicated on !shiftKey, so another function was needed for cases where we ignore other keys
This commit is contained in:
@@ -68,3 +68,12 @@ export function isOnlyCtrlOrCmdKeyEvent(ev) {
|
||||
return ev.ctrlKey && !ev.altKey && !ev.metaKey && !ev.shiftKey;
|
||||
}
|
||||
}
|
||||
|
||||
export function isCtrlOrCmdKeyEvent(ev) {
|
||||
const isMac = navigator.platform.toUpperCase().indexOf('MAC') >= 0;
|
||||
if (isMac) {
|
||||
return ev.metaKey && !ev.ctrlKey;
|
||||
} else {
|
||||
return ev.ctrlKey && !ev.metaKey;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user