Permalink
Browse files

Merge pull request #466 from yous/ctrl-bracket-flags

Handle Ctrl-[ only when other modifiers are not pressed
  • Loading branch information...
youknowone committed Dec 8, 2018
2 parents 3e99202 + 7e0ad83 commit 580baebe162251b5024ae2a98e4ada995cfba84b
Showing with 6 additions and 7 deletions.
  1. +6 −7 OSX/GureumComposer.swift
@@ -261,13 +261,12 @@ let GureumInputSourceToHangulKeyboardIdentifierTable: [GureumInputSourceIdentifi

if self.delegate === hangulComposer {
// Vi-mode: esc로 로마자 키보드로 전환
let controlPressed = !inputModifier.intersection(NSEvent.ModifierFlags.control).isEmpty
let shiftUnpressed = inputModifier.intersection(NSEvent.ModifierFlags.shift).isEmpty
let escapePressed = keyCode == kVK_Escape
if GureumConfiguration.shared.romanModeByEscapeKey && (escapePressed || (keyCode == kVK_ANSI_LeftBracket && shiftUnpressed && controlPressed)) {
self.delegate.cancelComposition()
(sender as AnyObject).selectMode(GureumConfiguration.shared.lastRomanInputMode)
return CIMInputTextProcessResult.notProcessedAndNeedsCommit
if GureumConfiguration.shared.romanModeByEscapeKey {
if keyCode == kVK_Escape || (keyCode, inputModifier) == (kVK_ANSI_LeftBracket, NSEvent.ModifierFlags.control) {
self.delegate.cancelComposition()
(sender as AnyObject).selectMode(GureumConfiguration.shared.lastRomanInputMode)
return CIMInputTextProcessResult.notProcessedAndNeedsCommit
}
}
}
return CIMInputTextProcessResult.notProcessed

0 comments on commit 580baeb

Please sign in to comment.