@ampatspell/ember-cli-keyboard
v0.0.1
Published
Simple keyboard keyDown service addon for ember-cli
Downloads
5
Readme
ember-cli-keyboard
Simple keyboard keyDown service addon for ember-cli.
Install
$ ember install @ampatspell/ember-cli-keyboard
Configure
Subclass service (optional):
// app/services/keyboard.js
import { Service } from 'keyboard';
export default Service.extend({
mapping: {
13: 'enter'
},
logKeyCodes: true
});
Add mixin for route:
// app/routes/index.js
import Ember from 'ember';
import { KeyboardRouteMixin } from 'keyboard';
export default Ember.Route.extend(KeyboardRouteMixin, {
});
Add keyboard handler methods in controller:
// app/controllers/index.js
import Ember from 'ember';
export default Ember.Controller.extend({
keyEnter: function() {
}
});