We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6074e4a commit 6c6ce24Copy full SHA for 6c6ce24
lib/assets/javascripts/commandz.coffee
@@ -20,11 +20,11 @@ class CommandZ
20
21
keyboardShortcuts: (enable=true) ->
22
addOrRemove = if enable then 'addEventListener' else 'removeEventListener'
23
- document[addOrRemove]('keypress', this.handleKeypress)
+ document[addOrRemove]('keydown', this.handleKeypress)
24
25
handleKeypress: (e) =>
26
return if document.activeElement.nodeName is 'INPUT'
27
- return unless (e.which is 122 and e.metaKey is true || e.which is 26 and e.ctrlKey is true)
+ return unless (e.which is 90 and e.metaKey is true || e.which is 26 and e.ctrlKey is true)
28
29
e.preventDefault()
30
if e.shiftKey then this.redo() else this.undo()
0 commit comments