diff options
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 |