Files
AstralRinth/apps/frontend/src/helpers/events.ts
Evan Song abec2e48d4 Add TailwindCSS (#1252)
* Setup TailwindCSS

* Fully setup configuration

* Refactor some tailwind variables
2024-07-06 20:57:32 -07:00

11 lines
368 B
TypeScript

/**
* Checks if any of the modifier keys is down for the event.
* @param e Event that is triggered with the state of modified keys.
* @returns Whether any of the modifier keys is pressed.
*/
export function isModifierKeyDown(
e: Pick<KeyboardEvent, "ctrlKey" | "altKey" | "metaKey" | "shiftKey">,
) {
return e.ctrlKey || e.altKey || e.metaKey || e.shiftKey;
}