keyboard.js 232 B

1234567891011121314
  1. const keys = {}
  2. export function addKeyboardKey (e) {
  3. keys[e.key] = true
  4. }
  5. export function removeKeyboardKey (e) {
  6. delete keys[e.key]
  7. }
  8. export function isCtrlPress(e) {
  9. // eslint-disable-next-line
  10. return keys['Control']
  11. }