keycomb
v0.1.3
Published
Key combinations parser
Downloads
518
Maintainers
Readme
keycomb
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});
License
MIT