https://github.com/koding/shortcuts
https://github.com/koding/shortcuts
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/koding/shortcuts
- Owner: koding
- License: mit
- Created: 2015-03-05T11:24:09.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2017-01-30T14:44:17.000Z (almost 9 years ago)
- Last Synced: 2025-07-31T07:08:35.893Z (5 months ago)
- Language: CoffeeScript
- Size: 33.2 KB
- Stars: 3
- Watchers: 5
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
# shortcuts
manages keyboard shortcuts in browser.
# usage
```js
var shortcuts = new Shortcuts({
foo: [
{ name: 'bar', binding: [ ['ctrl+x'], ['command+x'] ]}
]
});
shorcuts.on('key:foo', function () { })
```
See [keyconfig](https://github.com/tetsuo/keyconfig) for spec.
# api
# ctor(defaults={})
Returns an `events.EventEmitter`.
# .get(collectionName, modelName)
# .update(collectionName, modelName, value, silent)
# .getCollisions(collectionName)
# events
# `key:collectionName`
# `change`
# todo
* do not use mousetrap
# license
mit