init
This commit is contained in:
commit
a04776256d
56 changed files with 6808 additions and 0 deletions
10
lib/hooks/is-modifier-pressed.tsx
Normal file
10
lib/hooks/is-modifier-pressed.tsx
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
import { isAppleDevice } from "@/lib/tinykeys";
|
||||
|
||||
/**
|
||||
* Uses the Meta key on macOS, and the Ctrl key on other platforms.
|
||||
*/
|
||||
export const isModifierPressed = (
|
||||
event: KeyboardEvent | React.KeyboardEvent
|
||||
): boolean => {
|
||||
return isAppleDevice() ? event.metaKey : event.ctrlKey;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue