Forward compositionstart/end events to KeymapManager to avoid IME issues

This commit is contained in:
Nathan Sobo
2016-11-15 12:25:15 -07:00
parent 1917a33867
commit 3f788ebe7e
2 changed files with 9 additions and 1 deletions

View File

@@ -15,7 +15,7 @@
"electronVersion": "1.3.6",
"dependencies": {
"async": "0.2.6",
"atom-keymap": "7.1.4",
"atom-keymap": "7.2.0",
"atom-space-pen-views": "^2.0.0",
"atom-ui": "0.4.1",
"babel-core": "5.8.38",

View File

@@ -14,6 +14,8 @@ class WindowEventHandler
@addEventListener(@document, 'keyup', @handleDocumentKeyEvent)
@addEventListener(@document, 'keydown', @handleDocumentKeyEvent)
@addEventListener(@document, 'compositionstart', @handleDocumentCompositionStartEvent)
@addEventListener(@document, 'compositionend', @handleDocumentCompositionEndEvent)
@addEventListener(@document, 'drop', @handleDocumentDrop)
@addEventListener(@document, 'dragover', @handleDocumentDragover)
@addEventListener(@document, 'contextmenu', @handleDocumentContextmenu)
@@ -76,6 +78,12 @@ class WindowEventHandler
@atomEnvironment.keymaps.handleKeyboardEvent(event)
event.stopImmediatePropagation()
handleDocumentCompositionStartEvent: =>
@atomEnvironment.keymaps.handleCompositionStart()
handleDocumentCompositionEndEvent: =>
@atomEnvironment.keymaps.handleCompositionEnd()
handleDrop: (event) ->
event.preventDefault()
event.stopPropagation()