keycomb

0.1.3 • Public • Published

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});

License

MIT

Package Sidebar

Install

npm i keycomb

Weekly Downloads

13

Version

0.1.3

License

MIT

Last publish

Collaborators

  • andrepolischuk