diff options
author | Pushkar Joshi | 2012-02-28 14:19:25 -0800 |
---|---|---|
committer | Pushkar Joshi | 2012-02-28 14:19:25 -0800 |
commit | 16d6a90579cdafede931a9c818689fad2e622d8b (patch) | |
tree | e87f5d4a131d3574ef06cff1c46373d5b1046956 /js/mediators/keyboard-mediator.js | |
parent | 03ca7a5ed13c25faaa9100bb666e062fd15335e6 (diff) | |
parent | 63307c9abf120985d979a40a53a0598d3f0d5c5a (diff) | |
download | ninja-16d6a90579cdafede931a9c818689fad2e622d8b.tar.gz |
Merge branch 'pentool' into brushtool
Diffstat (limited to 'js/mediators/keyboard-mediator.js')
-rwxr-xr-x | js/mediators/keyboard-mediator.js | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/js/mediators/keyboard-mediator.js b/js/mediators/keyboard-mediator.js index 5b044f8a..bf436593 100755 --- a/js/mediators/keyboard-mediator.js +++ b/js/mediators/keyboard-mediator.js | |||
@@ -136,6 +136,13 @@ exports.KeyboardMediator = Montage.create(Component, { | |||
136 | return; | 136 | return; |
137 | } | 137 | } |
138 | 138 | ||
139 | // shortcut for Pen tool is P | ||
140 | if (evt.keyCode === Keyboard.P){ | ||
141 | evt.preventDefault(); | ||
142 | this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[5]}); | ||
143 | return; | ||
144 | } | ||
145 | |||
139 | // Shortcut for Rectangle Tool is R | 146 | // Shortcut for Rectangle Tool is R |
140 | // unless the user is pressing the command key. | 147 | // unless the user is pressing the command key. |
141 | // If the user is pressing the command key, they want to refresh the browser. | 148 | // If the user is pressing the command key, they want to refresh the browser. |
@@ -207,7 +214,13 @@ exports.KeyboardMediator = Montage.create(Component, { | |||
207 | 214 | ||
208 | // Check if cmd+s/ctrl+s for Save (Windows/Mac) | 215 | // Check if cmd+s/ctrl+s for Save (Windows/Mac) |
209 | if ((evt.keyCode == Keyboard.S) && (evt.ctrlKey || evt.metaKey) && !evt.shiftKey) { | 216 | if ((evt.keyCode == Keyboard.S) && (evt.ctrlKey || evt.metaKey) && !evt.shiftKey) { |
210 | NJevent("executeSave"); | 217 | try{ |
218 | NJevent("executeSave"); | ||
219 | } | ||
220 | catch(e){ | ||
221 | console.warn("Unable to save"); | ||
222 | console.log(e.stack); | ||
223 | } | ||
211 | evt.preventDefault(); | 224 | evt.preventDefault(); |
212 | return; | 225 | return; |
213 | } | 226 | } |