Skip to content
Permalink
Browse files

이모지 단축키 삭제하고 한자 단축키와 통합 외 (#652)

* 한자 or 이모지 단축키 -> 한자 and 이모지 단축키

* hanjaEmoji -> search

* SearchingComposer -> SearchComposer
  • Loading branch information...
presto95 authored and youknowone committed Oct 5, 2019
1 parent ac519f6 commit ab4e3f03abdb9d1d7a01ea7a12d9a721fd4f7267
@@ -23,14 +23,17 @@

/* Begin PBXBuildFile section */
0378CCB6A8DC8069FA2B6B55 /* Pods_OSXTestApp.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4F10FF4A81E4501FB2F71251 /* Pods_OSXTestApp.framework */; };
19136D73234090AA00A0BF3C /* SearchingComposer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19136D72234090AA00A0BF3C /* SearchingComposer.swift */; };
19136D73234090AA00A0BF3C /* SearchComposer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19136D72234090AA00A0BF3C /* SearchComposer.swift */; };
19A1229A23477D2700525AEC /* TISInputSource+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19A1229923477D2700525AEC /* TISInputSource+.swift */; };
19A122A323477DE900525AEC /* GureumShortcutValidator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19A122A223477DE900525AEC /* GureumShortcutValidator.swift */; };
19A122A523477E1D00525AEC /* GureumPreferencePane.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19A122A423477E1D00525AEC /* GureumPreferencePane.swift */; };
19E257A42327412500952E64 /* KeyCode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19E257A12327412500952E64 /* KeyCode.swift */; };
19E257A52327432500952E64 /* KeyCode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19E257A12327412500952E64 /* KeyCode.swift */; };
38098F0A215A3DB30001F159 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 38098F09215A3DB30001F159 /* Assets.xcassets */; };
38162DF5141263270077AA2D /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 38863C63140E64EB00A8ED76 /* Cocoa.framework */; };
38162DFB141263280077AA2D /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 38162DF9141263280077AA2D /* InfoPlist.strings */; };
38162E4814128A740077AA2D /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 38162E4914128A740077AA2D /* MainMenu.xib */; };
381CA2EF1FCE16EA00DDB81D /* Preferences.swift in Sources */ = {isa = PBXBuildFile; fileRef = 381CA2EE1FCE16EA00DDB81D /* Preferences.swift */; };
381CA2EF1FCE16EA00DDB81D /* PreferenceViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 381CA2EE1FCE16EA00DDB81D /* PreferenceViewController.swift */; };
381CA2F11FCE208A00DDB81D /* Example.png in Resources */ = {isa = PBXBuildFile; fileRef = 381CA2F01FCE208A00DDB81D /* Example.png */; };
382E686D1A1314D900031D1D /* Preferences.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 382E686C1A1314D900031D1D /* Preferences.tiff */; };
382E68701A1314D900031D1D /* Preferences.xib in Resources */ = {isa = PBXBuildFile; fileRef = 382E686E1A1314D900031D1D /* Preferences.xib */; };
@@ -267,7 +270,10 @@

/* Begin PBXFileReference section */
0432504D10DBDF90212C4042 /* Pods-OSX.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-OSX.release.xcconfig"; path = "Pods/Target Support Files/Pods-OSX/Pods-OSX.release.xcconfig"; sourceTree = "<group>"; };
19136D72234090AA00A0BF3C /* SearchingComposer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchingComposer.swift; sourceTree = "<group>"; };
19136D72234090AA00A0BF3C /* SearchComposer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchComposer.swift; sourceTree = "<group>"; };
19A1229923477D2700525AEC /* TISInputSource+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "TISInputSource+.swift"; sourceTree = "<group>"; };
19A122A223477DE900525AEC /* GureumShortcutValidator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GureumShortcutValidator.swift; sourceTree = "<group>"; };
19A122A423477E1D00525AEC /* GureumPreferencePane.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GureumPreferencePane.swift; sourceTree = "<group>"; };
19E257A12327412500952E64 /* KeyCode.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KeyCode.swift; sourceTree = "<group>"; };
236921790DBF83DCE3CCBB11 /* Pods-OSXTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-OSXTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-OSXTests/Pods-OSXTests.release.xcconfig"; sourceTree = "<group>"; };
32842EC3B8B92F2C1EFA62F6 /* Pods-OSXTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-OSXTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-OSXTests/Pods-OSXTests.debug.xcconfig"; sourceTree = "<group>"; };
@@ -279,7 +285,7 @@
38162E4914128A740077AA2D /* MainMenu.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainMenu.xib; sourceTree = "<group>"; };
381B32731DA826B100EA1975 /* Bridge.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Bridge.h; sourceTree = "<group>"; };
381CA2ED1FCE16EA00DDB81D /* Preferences-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Preferences-Bridging-Header.h"; sourceTree = "<group>"; };
381CA2EE1FCE16EA00DDB81D /* Preferences.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Preferences.swift; sourceTree = "<group>"; };
381CA2EE1FCE16EA00DDB81D /* PreferenceViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PreferenceViewController.swift; sourceTree = "<group>"; };
381CA2F01FCE208A00DDB81D /* Example.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Example.png; sourceTree = "<group>"; };
381DB19A21678B74005A37B9 /* Debug.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Debug.swift; sourceTree = "<group>"; };
382AF2DC21563C0600701F90 /* OSXTestApp-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "OSXTestApp-Bridging-Header.h"; sourceTree = "<group>"; };
@@ -494,7 +500,10 @@
382E68651A1314D900031D1D /* Preferences */ = {
isa = PBXGroup;
children = (
381CA2EE1FCE16EA00DDB81D /* Preferences.swift */,
19A1229923477D2700525AEC /* TISInputSource+.swift */,
19A122A423477E1D00525AEC /* GureumPreferencePane.swift */,
19A122A223477DE900525AEC /* GureumShortcutValidator.swift */,
381CA2EE1FCE16EA00DDB81D /* PreferenceViewController.swift */,
382E686C1A1314D900031D1D /* Preferences.tiff */,
382E686E1A1314D900031D1D /* Preferences.xib */,
381CA2F01FCE208A00DDB81D /* Example.png */,
@@ -601,7 +610,7 @@
389289BC217B331B00F94F2C /* Composer.swift */,
38D3E42A21213E9700751191 /* HangulComposer.swift */,
38C75C8B1F153A74004BE02A /* RomanComposer.swift */,
19136D72234090AA00A0BF3C /* SearchingComposer.swift */,
19136D72234090AA00A0BF3C /* SearchComposer.swift */,
E54B8381214299EB00527218 /* GureumComposer.swift */,
19E257A12327412500952E64 /* KeyCode.swift */,
3835B4E21F5DAA7100896BEC /* data */,
@@ -1237,7 +1246,10 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
381CA2EF1FCE16EA00DDB81D /* Preferences.swift in Sources */,
19A122A523477E1D00525AEC /* GureumPreferencePane.swift in Sources */,
19A1229A23477D2700525AEC /* TISInputSource+.swift in Sources */,
19A122A323477DE900525AEC /* GureumShortcutValidator.swift in Sources */,
381CA2EF1FCE16EA00DDB81D /* PreferenceViewController.swift in Sources */,
19E257A52327432500952E64 /* KeyCode.swift in Sources */,
388186AB21EB3E72004B7FDB /* Configuration.swift in Sources */,
);
@@ -1265,7 +1277,7 @@
3881868821EB2D8D004B7FDB /* GureumApplicationDelegate.swift in Sources */,
3881869321EB2DC0004B7FDB /* Configuration.swift in Sources */,
388186B121EB453E004B7FDB /* InputController.swift in Sources */,
19136D73234090AA00A0BF3C /* SearchingComposer.swift in Sources */,
19136D73234090AA00A0BF3C /* SearchComposer.swift in Sources */,
38B9551022A833E900A9D6E1 /* SystemConfigurationWatcher.swift in Sources */,
3881869121EB2DC0004B7FDB /* Debug.swift in Sources */,
388186A121EB3055004B7FDB /* GureumComposer.swift in Sources */,
@@ -505,7 +505,7 @@ class GureumTests: XCTestCase {
app.controller.setValue(GureumInputSource.qwerty.rawValue, forTag: kTextServiceInputModePropertyTag, client: app.client)

let composer = app.controller.receiver.composer
let emoticonComposer = composer.romanDependentSearchingComposer
let emoticonComposer = composer.romanDependentSearchComposer
emoticonComposer.delegate = composer.delegate // roman?
composer.delegate = emoticonComposer

@@ -18,10 +18,8 @@ enum ConfigurationName {

/// 입력기 바꾸기 단축키.
static let inputModeExchangeKey = "InputModeExchangeKey"
/// 이모티콘 단축키.
static let inputModeEmoticonKey = "InputModeEmoticonKey"
/// 한자 단축키.
static let inputModeHanjaKey = "InputModeHanjaKey"
/// 한자 및 이모지 검색 단축키.
static let inputModeSearchKey = "InputModeHanjaKey"
/// 로마자로 바꾸기 단축키.
static let inputModeEnglishKey = "InputModeEnglishKey"
/// 한글로 바꾸기 단축키.
@@ -77,8 +75,7 @@ public class Configuration: UserDefaults {
ConfigurationName.lastHangulInputMode: "org.youknowone.inputmethod.Gureum.han2",
ConfigurationName.lastRomanInputMode: "org.youknowone.inputmethod.Gureum.qwerty",

ConfigurationName.inputModeEmoticonKey: Configuration.convertShortcutToConfiguration((.return, [.shift, .option])),
ConfigurationName.inputModeHanjaKey: Configuration.convertShortcutToConfiguration((.return, .option)),
ConfigurationName.inputModeSearchKey: Configuration.convertShortcutToConfiguration((.return, .option)),
ConfigurationName.optionKeyBehavior: 0,
ConfigurationName.overridingKeyboardName: "com.apple.keylayout.ABC",

@@ -141,37 +138,27 @@ public class Configuration: UserDefaults {
/// 입력기 바꾸기 단축키.
var inputModeExchangeKey: Shortcut? {
get {
return getShortcut(forKey: ConfigurationName.inputModeExchangeKey)
return shortcut(forKey: ConfigurationName.inputModeExchangeKey)
}
set {
setShortcut(newValue, forKey: ConfigurationName.inputModeExchangeKey)
}
}

/// 이모티콘 단축키.
var inputModeEmoticonKey: Shortcut? {
/// 한자 및 이모지 검색 단축키.
var inputModeSearchKey: Shortcut? {
get {
return getShortcut(forKey: ConfigurationName.inputModeEmoticonKey)
return shortcut(forKey: ConfigurationName.inputModeSearchKey)
}
set {
setShortcut(newValue, forKey: ConfigurationName.inputModeEmoticonKey)
}
}

/// 한자 단축키.
var inputModeHanjaKey: Shortcut? {
get {
return getShortcut(forKey: ConfigurationName.inputModeHanjaKey)
}
set {
setShortcut(newValue, forKey: ConfigurationName.inputModeHanjaKey)
setShortcut(newValue, forKey: ConfigurationName.inputModeSearchKey)
}
}

/// 로마자로 바꾸기 단축키.
var inputModeEnglishKey: Shortcut? {
get {
return getShortcut(forKey: ConfigurationName.inputModeEnglishKey)
return shortcut(forKey: ConfigurationName.inputModeEnglishKey)
}
set {
setShortcut(newValue, forKey: ConfigurationName.inputModeEnglishKey)
@@ -181,7 +168,7 @@ public class Configuration: UserDefaults {
/// 한글로 바꾸기 단축키.
var inputModeKoreanKey: Shortcut? {
get {
return getShortcut(forKey: ConfigurationName.inputModeKoreanKey)
return shortcut(forKey: ConfigurationName.inputModeKoreanKey)
}
set {
setShortcut(newValue, forKey: ConfigurationName.inputModeKoreanKey)
@@ -240,7 +227,7 @@ public class Configuration: UserDefaults {
}

private extension Configuration {
func getShortcut(forKey key: String) -> Shortcut? {
func shortcut(forKey key: String) -> Shortcut? {
guard let value = dictionary(forKey: key) else { return nil }
return Configuration.convertConfigurationToShortcut(value)
}
@@ -63,11 +63,11 @@ final class GureumComposer: Composer {
/// 한글 합성기에 의존하여 문자를 검색하고 입력하는 합성기.
///
/// 한자 및 이모지는 해당 합성기를 사용하여 입력이 이루어진다.
let hangulDependentSearchingComposer = SearchingComposer(dependentComposerType: .hangul)
let hangulDependentSearchComposer = SearchComposer(dependentComposerType: .hangul)
/// 로마자 합성기에 의존하여 문자를 검색하고 입력하는 합성기.
///
/// 이모지는 해당 합성기를 사용하여 입력이 이루어진다.
let romanDependentSearchingComposer = SearchingComposer(dependentComposerType: .roman)
let romanDependentSearchComposer = SearchComposer(dependentComposerType: .roman)
/// 로마자 시스템 합성기.
let systemRomanComposer = RomanComposer(type: .system)
/// 로마자 쿼티 합성기.
@@ -86,7 +86,7 @@ final class GureumComposer: Composer {
init() {
romanComposer = qwertyComposer
delegate = romanComposer
hangulDependentSearchingComposer.delegate = hangulComposer
hangulDependentSearchComposer.delegate = hangulComposer
}

// MARK: Composer 프로토콜 구현
@@ -100,8 +100,8 @@ final class GureumComposer: Composer {
func clear() {
hangulComposer.clear()
romanComposer.clear()
hangulDependentSearchingComposer.clear()
romanDependentSearchingComposer.clear()
hangulDependentSearchComposer.clear()
romanDependentSearchComposer.clear()
}

func dequeueCommitString() -> String {
@@ -162,19 +162,19 @@ extension GureumComposer {
enqueueCommitString(delegate.dequeueCommitString())
inputMode = layout == .hangul ? config.lastHangulInputMode : config.lastRomanInputMode
return InputResult(processed: true, action: .layout(inputMode))
case .hanja:
case .search:
// 한글 입력 상태에서 한자 및 이모티콘 입력기로 전환
if delegate is HangulComposer {
// 현재 조합 중 여부에 따라 한자 모드 여부를 결정
let isComposing = !hangulComposer.composedString.isEmpty
hangulDependentSearchingComposer.showsCandidateWindow = !isComposing
delegate = hangulDependentSearchingComposer
hangulDependentSearchComposer.showsCandidateWindow = !isComposing
delegate = hangulDependentSearchComposer
delegate.composerSelected()
hangulDependentSearchingComposer.update(client: sender as! IMKTextInput)
hangulDependentSearchComposer.update(client: sender as! IMKTextInput)
} else if delegate is RomanComposer {
romanDependentSearchingComposer.delegate = delegate
delegate = romanDependentSearchingComposer
romanDependentSearchingComposer.update(client: sender as! IMKTextInput)
romanDependentSearchComposer.delegate = delegate
delegate = romanDependentSearchComposer
romanDependentSearchComposer.update(client: sender as! IMKTextInput)
} else {
return .notProcessed
}
@@ -204,11 +204,11 @@ extension GureumComposer {
if delegate is RomanComposer, let shortcutKey = configuration.inputModeKoreanKey, shortcutKey == inputKey {
return .changeLayout(.hangul, true)
}
if let shortcutKey = configuration.inputModeHanjaKey, shortcutKey == inputKey {
return .changeLayout(.hanja, true)
if let shortcutKey = configuration.inputModeSearchKey, shortcutKey == inputKey {
return .changeLayout(.search, true)
}

if let searchingComposer = delegate as? SearchingComposer {
if let searchingComposer = delegate as? SearchComposer {
if searchingComposer.dependentComposerType == .hangul, !searchingComposer.showsCandidateWindow, searchingComposer.composedString.isEmpty, searchingComposer.commitString.isEmpty {
// 한자 입력이 완료되었고 한자 모드도 아님
delegate = hangulComposer
@@ -39,7 +39,7 @@ enum ChangeLayout {
case toggleByCapsLock
case hangul
case roman
case hanja
case search
}

enum InputEvent {

0 comments on commit ab4e3f0

Please sign in to comment.
You can’t perform that action at this time.