mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-06 17:11:55 +00:00
feat(messaging): add message overlay logic
This commit is contained in:
18
src/lib/modifiers.ts
Normal file
18
src/lib/modifiers.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Utility file for detecting whether the
|
||||
* shift key is currently pressed or not.
|
||||
*/
|
||||
|
||||
export let shiftKeyPressed = false;
|
||||
|
||||
if (typeof window !== "undefined") {
|
||||
document.addEventListener("keydown", (ev) => {
|
||||
if (ev.shiftKey) shiftKeyPressed = true;
|
||||
else shiftKeyPressed = false;
|
||||
});
|
||||
|
||||
document.addEventListener("keyup", (ev) => {
|
||||
if (ev.shiftKey) shiftKeyPressed = true;
|
||||
else shiftKeyPressed = false;
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user