Add alt condition back in, rename to specify igorance of shift

because this is really what this function is for - we want to
ignore specifically shift but not necessarily alt (despite
this probably not having any real impact).
pull/21833/head
lukebarnard 2018-01-04 12:06:13 +00:00
parent d495519986
commit d5e2a73d99
1 changed files with 3 additions and 3 deletions

View File

@ -69,11 +69,11 @@ export function isOnlyCtrlOrCmdKeyEvent(ev) {
} }
} }
export function isCtrlOrCmdKeyEvent(ev) { export function isOnlyCtrlOrCmdIgnoreShiftKeyEvent(ev) {
const isMac = navigator.platform.toUpperCase().indexOf('MAC') >= 0; const isMac = navigator.platform.toUpperCase().indexOf('MAC') >= 0;
if (isMac) { if (isMac) {
return ev.metaKey && !ev.ctrlKey; return ev.metaKey && !ev.altKey && !ev.ctrlKey;
} else { } else {
return ev.ctrlKey && !ev.metaKey; return ev.ctrlKey && !ev.altKey && !ev.metaKey;
} }
} }