1 define(function(require) {
5 var _ = require('libs/underscore'),
6 keyboard = require('modules/documentCanvas/canvas/keyboard');
8 var KEYS = keyboard.KEYS;
10 var KeyEvent = function(params) {
11 this.key = params.key;
12 this.ctrlKey = params.ctrlKey;
13 this._nativeEvent = params._nativeEvent;
16 _.extend(KeyEvent.prototype, KEYS, {
18 return k === this.key;
20 preventDefault: function() {
21 if(this._nativeEvent) {
22 this._nativeEvent.preventDefault();
28 fromParams: function(params) {
29 return new KeyEvent(params);
31 fromNativeEvent: function(e) {
32 return this.fromParams({