diff --git a/app/assets/javascripts/command.js b/app/assets/javascripts/command.js index 669afa4..47a616c 100644 --- a/app/assets/javascripts/command.js +++ b/app/assets/javascripts/command.js @@ -5,6 +5,7 @@ var mousetrapList = ["escape", "ctrl"] applyMousetrapIfNeeded(); interceptCtrlR(); +interceptCtrlO(); function interceptCtrlR () { if (contains(keystrokes, ["ctrl+r"])) { @@ -19,6 +20,19 @@ function interceptCtrlR () { } } +function interceptCtrlO () { + if (contains(keystrokes, ["ctrl+o"])) { + $("body").on("keydown", function (e) { + if (e.ctrlKey && e.keyCode == 79) { + successCommand(); + event.keyCode = 0; + event.cancelBubble = true; + return false; + } + }); + } +} + $(document).keyup( function() { userText = keysPressed(); $.each(keystrokes, function (index, keystroke) {