Skip to content

andrepolischuk/keycomb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

keycomb Build Status

Key combinations parser

Install

npm install --save keycomb
component install andrepolischuk/keycomb

Usage

var keycomb = require('keycomb');

keycomb('alt+a+m'); // {altKey: true, ctrlKey: false, shiftKey: false, keyCode: [65, 77]}
keycomb({ctrlKey: true, keyCode: 67}); // ['ctrl', 'c']

API

keycomb(string)

keycomb(array)

Return combination object

keycomb('alt+a+m');
keycomb(['ctrl', 'c']);

keycomb(object)

Return combination array

keycomb({altKey: true, keyCode: [65, 77]});
keycomb({ctrlKey: true, keyCode: 67});

Related

  • keycodes — key codes and names
  • ks — keyboard shortcuts

License

MIT

About

Key combinations parser

Resources

License

Stars

Watchers

Forks

Packages

No packages published