Merge pull request #10921 from atom/bo-keyup

Add support for keybindings with keyup keystrokes
This commit is contained in:
Ben Ogle
2016-02-22 14:28:16 -08:00
2 changed files with 5 additions and 4 deletions

View File

@@ -15,7 +15,7 @@
"electronVersion": "0.36.8",
"dependencies": {
"async": "0.2.6",
"atom-keymap": "^6.2.0",
"atom-keymap": "^6.3.1",
"babel-core": "^5.8.21",
"bootstrap": "^3.3.4",
"cached-run-in-this-context": "0.4.1",
@@ -96,7 +96,7 @@
"grammar-selector": "0.48.1",
"image-view": "0.56.0",
"incompatible-packages": "0.25.1",
"keybinding-resolver": "0.33.0",
"keybinding-resolver": "0.35.0",
"line-ending-selector": "0.3.1",
"link": "0.31.0",
"markdown-preview": "0.157.3",

View File

@@ -15,7 +15,8 @@ class WindowEventHandler
@addEventListener(@window, 'focus', @handleWindowFocus)
@addEventListener(@window, 'blur', @handleWindowBlur)
@addEventListener(@document, 'keydown', @handleDocumentKeydown)
@addEventListener(@document, 'keyup', @handleDocumentKeyEvent)
@addEventListener(@document, 'keydown', @handleDocumentKeyEvent)
@addEventListener(@document, 'drop', @handleDocumentDrop)
@addEventListener(@document, 'dragover', @handleDocumentDragover)
@addEventListener(@document, 'contextmenu', @handleDocumentContextmenu)
@@ -66,7 +67,7 @@ class WindowEventHandler
target.addEventListener(eventName, handler)
@subscriptions.add(new Disposable(-> target.removeEventListener(eventName, handler)))
handleDocumentKeydown: (event) =>
handleDocumentKeyEvent: (event) =>
@atomEnvironment.keymaps.handleKeyboardEvent(event)
event.stopImmediatePropagation()