keyboard-shortcuts

Keyboard shortcuts

Usage no npm install needed!

<script type="module">
  import keyboardShortcuts from 'https://cdn.skypack.dev/keyboard-shortcuts';
</script>

README

keyboard-shortcuts

npm David David

Keyboard shortcuts

import Keys, { getKeyCombo } from 'keyboard-shortcuts';

const key = Keys.c; // Symbol(c)
Keys[key]; // 'c'

const event = {
  altKey: false
  charCode: 99
  ctrlKey: false
  keyCode: 99
  keyIdentifier: "U+0043"
  metaKey: false
  shiftKey: false
  timeStamp: 1440844681923
  type: "keypress"
  which: 99
};
getKeyCombo(event); // Symbol(c)