piskel/js/service/keyboard/KeyboardEvent.js
jdescottes 25e6470499 feature : add keyboard shortcuts : keycodes
+ moved keycode translation to KeycodeTranslator
+ made KeycodeTranslator more generic to handle 0-9 and a-z keys
+ small refactor in KeyboardEventService
2013-11-17 21:15:53 +01:00

18 lines
417 B
JavaScript

(function () {
var ns = $.namespace('service.keyboard');
ns.KeyboardEvent = function (eventName, args, description) {
this.eventName = eventName;
this.args = args;
this.description = description;
};
ns.KeyboardEvent.prototype.fire = function () {
$.publish(this.eventName, this.args);
};
ns.KeyboardEvent.prototype.getDescription = function () {
return this.description;
};
})();