diff --git a/src/tool/ToolEvent.js b/src/tool/ToolEvent.js index 83ba2f2d..10f677d6 100644 --- a/src/tool/ToolEvent.js +++ b/src/tool/ToolEvent.js @@ -212,7 +212,7 @@ var ToolEvent = this.ToolEvent = Base.extend({ return '{ type: ' + this.type + ', point: ' + this.point + ', count: ' + this.count - + ', modifiers: ' + this.modifiers + + ', modifiers: ' + this.getModifiers(true) + ' }'; } }); diff --git a/src/ui/Event.js b/src/ui/Event.js index f05b6242..28eed5a2 100644 --- a/src/ui/Event.js +++ b/src/ui/Event.js @@ -35,7 +35,9 @@ var Event = this.Event = Base.extend({ this.preventDefault(); }, - getModifiers: function() { - return Key.modifiers; + getModifiers: function(asString) { + return asString ? '{ ' + Base.each(Key.modifiers, function(value, key) { + this.push(key + ': ' + value); + }, []).join(', ') + ' }' : Key.modifiers; } }); diff --git a/src/ui/KeyEvent.js b/src/ui/KeyEvent.js index 1f208a0b..996825f6 100644 --- a/src/ui/KeyEvent.js +++ b/src/ui/KeyEvent.js @@ -27,7 +27,7 @@ var KeyEvent = this.KeyEvent = Event.extend(new function() { return '{ type: ' + this.type + ', key: ' + this.key + ', character: ' + this.character - + ', modifiers: ' + this.modifiers + + ', modifiers: ' + this.getModifiers(true) + ' }'; } };