npm.io
1.1.0 • Published 8 years ago

shortcut-string

Licence
MIT
Version
1.1.0
Deps
1
Size
3 kB
Vulns
0
Weekly
0
Stars
1

shortcut-string

This module returns the textual representation of a shortcut given a keyboard event. Examples of shortcuts:

  • Cmd+L
  • Cmd+Shift+M
  • Ctrl+O
  • Backspace
  • T
  • Right
  • Shift+Down
  • Shift+F1
  • Ctrl++
  • Ctrl+Left
var shortcutString = require('shortcut-string');

document.addEventListener('keydown', function(event) {
  console.log(shortcutString.fromEvent(event));
});