Skip to content

circuitsim/keyboard-shortcuts

Repository files navigation

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)