15
common/resources/client/utils/keybinds/is-ctrl-key-pressed.ts
Executable file
15
common/resources/client/utils/keybinds/is-ctrl-key-pressed.ts
Executable file
@@ -0,0 +1,15 @@
|
||||
import {isMac} from '@react-aria/utils';
|
||||
|
||||
interface Event {
|
||||
altKey: boolean;
|
||||
ctrlKey: boolean;
|
||||
metaKey: boolean;
|
||||
}
|
||||
|
||||
export function isCtrlKeyPressed(e: Event) {
|
||||
if (isMac()) {
|
||||
return e.metaKey;
|
||||
}
|
||||
|
||||
return e.ctrlKey;
|
||||
}
|
||||
Reference in New Issue
Block a user