diff options
author | WlodekM <[email protected]> | 2024-11-30 18:11:32 +0200 |
---|---|---|
committer | WlodekM <[email protected]> | 2024-11-30 18:11:32 +0200 |
commit | 97157622be86c68f69e6e48f3746ca2c70b7e8a8 (patch) | |
tree | 32fe8069343d2b41f01b2d58325942fb43864056 /lib/key.js |
initial commit
Diffstat (limited to 'lib/key.js')
-rw-r--r-- | lib/key.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/key.js b/lib/key.js new file mode 100644 index 0000000..7f7971a --- /dev/null +++ b/lib/key.js @@ -0,0 +1,16 @@ +window.onkeydown = function (e) { + if (!e) e = window.event; + shiftHeld = e.shiftKey; +}; + +window.onkeyup = function (e) { + if (!e) e = window.event; + shiftHeld = e.shiftKey; +}; + +window.onmousemove = function (e) { + if (!e) e = window.event; + shiftHeld = e.shiftKey; +}; + +export let shiftHeld; \ No newline at end of file |