|
24 | 24 | * |
25 | 25 | * @extends Event |
26 | 26 | */ |
27 | | -var KeyEvent = this.KeyEvent = Event.extend(new function() { |
28 | | - return /** @lends KeyEvent# */{ |
29 | | - initialize: function(down, key, character, event) { |
30 | | - this.base(event); |
31 | | - this.type = down ? 'keydown' : 'keyup'; |
32 | | - this.key = key; |
33 | | - this.character = character; |
34 | | - }, |
| 27 | +var KeyEvent = this.KeyEvent = Event.extend(/** @lends KeyEvent# */{ |
| 28 | + initialize: function(down, key, character, event) { |
| 29 | + this.base(event); |
| 30 | + this.type = down ? 'keydown' : 'keyup'; |
| 31 | + this.key = key; |
| 32 | + this.character = character; |
| 33 | + }, |
35 | 34 |
|
36 | | - /** |
37 | | - * The type of key event. |
38 | | - * |
39 | | - * @name KeyEvent#type |
40 | | - * @type String('keydown', 'keyup') |
41 | | - */ |
| 35 | + /** |
| 36 | + * The type of key event. |
| 37 | + * |
| 38 | + * @name KeyEvent#type |
| 39 | + * @type String('keydown', 'keyup') |
| 40 | + */ |
42 | 41 |
|
43 | | - /** |
44 | | - * The string character of the key that caused this key event. |
45 | | - * |
46 | | - * @name KeyEvent#character |
47 | | - * @type String |
48 | | - */ |
| 42 | + /** |
| 43 | + * The string character of the key that caused this key event. |
| 44 | + * |
| 45 | + * @name KeyEvent#character |
| 46 | + * @type String |
| 47 | + */ |
49 | 48 |
|
50 | | - /** |
51 | | - * The key that caused this key event. |
52 | | - * |
53 | | - * @name KeyEvent#key |
54 | | - * @type String |
55 | | - */ |
| 49 | + /** |
| 50 | + * The key that caused this key event. |
| 51 | + * |
| 52 | + * @name KeyEvent#key |
| 53 | + * @type String |
| 54 | + */ |
56 | 55 |
|
57 | | - /** |
58 | | - * @return {String} A string representation of the key event. |
59 | | - */ |
60 | | - toString: function() { |
61 | | - return '{ type: ' + this.type |
62 | | - + ', key: ' + this.key |
63 | | - + ', character: ' + this.character |
64 | | - + ', modifiers: ' + this.getModifiers() |
65 | | - + ' }'; |
66 | | - } |
67 | | - }; |
| 56 | + /** |
| 57 | + * @return {String} A string representation of the key event. |
| 58 | + */ |
| 59 | + toString: function() { |
| 60 | + return '{ type: ' + this.type |
| 61 | + + ', key: ' + this.key |
| 62 | + + ', character: ' + this.character |
| 63 | + + ', modifiers: ' + this.getModifiers() |
| 64 | + + ' }'; |
| 65 | + } |
68 | 66 | }); |
0 commit comments