Permalink
Browse files

independent Option/Command as a shortcut... FAILED!

  • Loading branch information...
youknowone committed Jun 5, 2014
1 parent 0dfcbe2 commit aa19d2a75f95f721aef83a85826eae25a72c699b
Showing with 596 additions and 223 deletions.
  1. +3 −0 .gitmodules
  2. +3 −3 CommonInputMethod/CIMComposer.m
  3. +21 −2 CommonInputMethod/CIMConfiguration.h
  4. +20 −0 CommonInputMethod/CIMConfiguration.m
  5. +15 −8 CommonInputMethod/CIMInputController.m
  6. +5 −1 CommonInputMethod/CIMInputHandler.m
  7. +35 −87 Gureum.xcodeproj/project.pbxproj
  8. +0 −11 GureumOSX/tools/build_product.sh
  9. +2 −2 HACKING.md
  10. 0 {GureumOSX → OSX}/.gitignore
  11. 0 {GureumOSX → OSX}/CIMInputControllerGureum.h
  12. 0 {GureumOSX → OSX}/CIMInputControllerGureum.m
  13. 0 {GureumOSX → OSX}/GureumAppDelegate.h
  14. 0 {GureumOSX → OSX}/GureumAppDelegate.m
  15. +2 −0 {GureumOSX → OSX}/GureumComposer.h
  16. +76 −5 {GureumOSX → OSX}/GureumComposer.m
  17. +14 −4 {GureumOSX → OSX}/GureumPreferencesWindowController.h
  18. +40 −13 {GureumOSX → OSX}/GureumPreferencesWindowController.m
  19. +6 −0 {GureumOSX → OSX}/Hangul.strings
  20. 0 {GureumOSX → OSX}/HangulComposer.h
  21. 0 {GureumOSX → OSX}/HangulComposer.m
  22. 0 {GureumOSX → OSX}/Icons/COPYING
  23. BIN {GureumOSX → OSX}/Icons/Gureum.iconset/icon_128x128.png
  24. BIN {GureumOSX → OSX}/Icons/Gureum.iconset/icon_128x128@2x.png
  25. BIN {GureumOSX → OSX}/Icons/Gureum.iconset/icon_16x16.png
  26. BIN {GureumOSX → OSX}/Icons/Gureum.iconset/icon_16x16@2x.png
  27. BIN {GureumOSX → OSX}/Icons/Gureum.iconset/icon_256x256.png
  28. BIN {GureumOSX → OSX}/Icons/Gureum.iconset/icon_256x256@2x.png
  29. BIN {GureumOSX → OSX}/Icons/Gureum.iconset/icon_32x32.png
  30. BIN {GureumOSX → OSX}/Icons/Gureum.iconset/icon_32x32@2x.png
  31. BIN {GureumOSX → OSX}/Icons/Gureum.iconset/icon_512x512.png
  32. BIN {GureumOSX → OSX}/Icons/Gureum.iconset/icon_512x512@2x.png
  33. BIN {GureumOSX → OSX}/Icons/Gureum_psd/icon_128x128.psd
  34. BIN {GureumOSX → OSX}/Icons/Gureum_psd/icon_16x16.psd
  35. BIN {GureumOSX → OSX}/Icons/Gureum_psd/icon_256x256.psd
  36. BIN {GureumOSX → OSX}/Icons/Gureum_psd/icon_32x32.psd
  37. BIN {GureumOSX → OSX}/Icons/Gureum_psd/icon_32x32@2x.psd
  38. BIN {GureumOSX → OSX}/Icons/Gureum_psd/icon_512x512.psd
  39. BIN {GureumOSX → OSX}/Icons/Gureum_psd/icon_512x512@2x.psd
  40. BIN {GureumOSX → OSX}/Icons/colemak.png
  41. BIN {GureumOSX → OSX}/Icons/colemak@2x.png
  42. BIN OSX/Icons/command.png
  43. BIN {GureumOSX → OSX}/Icons/dvorak.png
  44. BIN {GureumOSX → OSX}/Icons/dvorak@2x.png
  45. BIN {GureumOSX → OSX}/Icons/eng.png
  46. BIN {GureumOSX → OSX}/Icons/eng@2x.png
  47. BIN {GureumOSX → OSX}/Icons/han.png
  48. BIN {GureumOSX → OSX}/Icons/han2.png
  49. BIN {GureumOSX → OSX}/Icons/han2@2x.png
  50. BIN {GureumOSX → OSX}/Icons/han3.png
  51. BIN {GureumOSX → OSX}/Icons/han390.png
  52. BIN {GureumOSX → OSX}/Icons/han390@2x.png
  53. BIN {GureumOSX → OSX}/Icons/han3@2x.png
  54. BIN {GureumOSX → OSX}/Icons/han3final.png
  55. BIN {GureumOSX → OSX}/Icons/han3final@2x.png
  56. BIN {GureumOSX → OSX}/Icons/han@2x.png
  57. BIN {GureumOSX → OSX}/Icons/hanroman.png
  58. BIN {GureumOSX → OSX}/Icons/hanroman@2x.png
  59. BIN {GureumOSX → OSX}/Icons/icons_psd/icons.psd
  60. BIN {GureumOSX → OSX}/Icons/icons_psd/icons@2x.psd
  61. BIN {GureumOSX → OSX}/Icons/libhangul_logo.png
  62. BIN {GureumOSX → OSX}/Icons/qwerty.png
  63. BIN {GureumOSX → OSX}/Icons/qwerty@2x.png
  64. 0 {GureumOSX → OSX}/Info.plist
  65. 0 {GureumOSX → OSX}/MainMenu.xib
  66. 0 {GureumOSX → OSX}/Prefix.pch
  67. 0 {GureumOSX → OSX}/ShortcutRecorder
  68. 0 {GureumOSX → OSX}/en.lproj/InfoPlist.strings
  69. 0 {GureumOSX → OSX}/ko.lproj/InfoPlist.strings
  70. 0 {GureumOSX → OSX}/main.m
  71. +334 −83 {GureumOSX → OSX}/preferences.xib
  72. 0 {GureumOSX → OSX}/tools/Makefile
  73. +11 −0 OSX/tools/build_product.sh
  74. +1 −1 {GureumOSX → OSX}/tools/install_debug.sh
  75. 0 {GureumOSX → OSX}/tools/preinst.plist
  76. 0 {GureumOSX → OSX}/tools/ready.sh
  77. 0 {GureumOSX → OSX}/tools/test_product.sh
  78. +8 −3 Podfile
View
@@ -1,3 +1,6 @@
[submodule "libhangul-objc"]
path = libhangul-objc
url = git://github.com/gureum/libhangul-objc.git
[submodule "ShortcutRecorder"]
path = OSX/ShortcutRecorder
url = git://github.com/gureum/shortcutrecorder.git
@@ -64,7 +64,7 @@ - (CIMInputTextProcessResult)inputController:(CIMInputController *)controller co
return [_delegate inputController:controller commandString:string key:keyCode modifiers:flags client:sender];
}
- (BOOL)inputController:(CIMInputController *)controller inputText:(NSString *)string key:(NSInteger)keyCode modifiers:(NSUInteger)flags client:(id)sender {
- (CIMInputTextProcessResult)inputController:(CIMInputController *)controller inputText:(NSString *)string key:(NSInteger)keyCode modifiers:(NSUInteger)flags client:(id)sender {
return [_delegate inputController:controller inputText:string key:keyCode modifiers:flags client:sender];
}
@@ -98,8 +98,8 @@ - (NSArray *)candidates { return nil; }
#pragma -
- (BOOL)inputController:(CIMInputController *)controller inputText:(NSString *)string key:(NSInteger)keyCode modifiers:(NSUInteger)flags client:(id)sender {
return NO;
- (CIMInputTextProcessResult)inputController:(CIMInputController *)controller inputText:(NSString *)string key:(NSInteger)keyCode modifiers:(NSUInteger)flags client:(id)sender {
return CIMInputTextProcessResultNotProcessed;
}
@end
@@ -12,12 +12,23 @@
/* Gureum */
FOUNDATION_EXTERN NSString *CIMLastHangulInputMode;
#define CIMConfigurationIntegerItemCount 7
/* Gureum */
#define CIMConfigurationIntegerItemCount 17
/* Shortcut */
FOUNDATION_EXTERN NSString *CIMLeftCommandKeyShortcutBehavior;
FOUNDATION_EXTERN NSString *CIMLeftOptionKeyShortcutBehavior;
FOUNDATION_EXTERN NSString *CIMLeftControlKeyShortcutBehavior;
FOUNDATION_EXTERN NSString *CIMRightCommandKeyShortcutBehavior;
FOUNDATION_EXTERN NSString *CIMRightOptionKeyShortcutBehavior;
FOUNDATION_EXTERN NSString *CIMRightControlKeyShortcutBehavior;
FOUNDATION_EXTERN NSString *CIMInputModeExchangeKeyModifier;
FOUNDATION_EXTERN NSString *CIMInputModeExchangeKeyCode;
FOUNDATION_EXTERN NSString *CIMInputModeHanjaKeyModifier;
FOUNDATION_EXTERN NSString *CIMInputModeHanjaKeyCode;
FOUNDATION_EXTERN NSString *CIMInputModeEnglishKeyModifier;
FOUNDATION_EXTERN NSString *CIMInputModeEnglishKeyCode;
FOUNDATION_EXTERN NSString *CIMInputModeKoreanKeyModifier;
FOUNDATION_EXTERN NSString *CIMInputModeKoreanKeyCode;
/* Gureum */
FOUNDATION_EXTERN NSString *CIMOptionKeyBehavior;
/* Hangul */
FOUNDATION_EXTERN NSString *CIMHangulCombinationModeComposing;
@@ -69,8 +80,16 @@ extern CIMConfiguration *CIMDefaultUserConfiguration;
NSUserDefaults *userDefaults;
@public
NSString *lastHangulInputMode;
NSInteger leftCommandKeyShortcutBehavior;
NSInteger leftOptionKeyShortcutBehavior;
NSInteger leftControlKeyShortcutBehavior;
NSInteger rightCommandKeyShortcutBehavior;
NSInteger rightOptionKeyShortcutBehavior;
NSInteger rightControlKeyShortcutBehavior;
NSInteger inputModeExchangeKeyModifier, inputModeExchangeKeyCode;
NSInteger inputModeHanjaKeyModifier, inputModeHanjaKeyCode;
NSInteger inputModeEnglishKeyModifier, inputModeEnglishKeyCode;
NSInteger inputModeKoreanKeyModifier, inputModeKoreanKeyCode;
NSInteger optionKeyBehavior;
NSInteger hangulCombinationModeComposing, hangulCombinationModeCommiting;
BOOL sharedInputManager;
@@ -13,10 +13,20 @@
define_preference_key(CIMLastHangulInputMode);
define_preference_key(CIMLeftCommandKeyShortcutBehavior);
define_preference_key(CIMLeftOptionKeyShortcutBehavior);
define_preference_key(CIMLeftControlKeyShortcutBehavior);
define_preference_key(CIMRightCommandKeyShortcutBehavior);
define_preference_key(CIMRightOptionKeyShortcutBehavior);
define_preference_key(CIMRightControlKeyShortcutBehavior);
define_preference_key(CIMInputModeExchangeKeyModifier);
define_preference_key(CIMInputModeExchangeKeyCode);
define_preference_key(CIMInputModeHanjaKeyModifier);
define_preference_key(CIMInputModeHanjaKeyCode);
define_preference_key(CIMInputModeEnglishKeyModifier);
define_preference_key(CIMInputModeEnglishKeyCode);
define_preference_key(CIMInputModeKoreanKeyModifier);
define_preference_key(CIMInputModeKoreanKeyCode);
define_preference_key(CIMOptionKeyBehavior);
define_preference_key(CIMHangulCombinationModeComposing);
define_preference_key(CIMHangulCombinationModeCommiting);
@@ -57,10 +67,20 @@ - (id)initWithUserDefaults:(NSUserDefaults *)aUserDefaults {
}
struct CIMConfigurationIntegerItem tempIntegerItems[CIMConfigurationIntegerItemCount] = {
{ CIMLeftCommandKeyShortcutBehavior, &self->leftCommandKeyShortcutBehavior, 0 },
{ CIMLeftOptionKeyShortcutBehavior, &self->leftOptionKeyShortcutBehavior, 0 },
{ CIMLeftControlKeyShortcutBehavior, &self->leftControlKeyShortcutBehavior, 0 },
{ CIMRightCommandKeyShortcutBehavior, &self->rightCommandKeyShortcutBehavior, 1 },
{ CIMRightOptionKeyShortcutBehavior, &self->rightOptionKeyShortcutBehavior, 2 },
{ CIMRightControlKeyShortcutBehavior, &self->rightControlKeyShortcutBehavior, 0 },
{ CIMInputModeExchangeKeyModifier, &self->inputModeExchangeKeyModifier, NSShiftKeyMask },
{ CIMInputModeExchangeKeyCode, &self->inputModeExchangeKeyCode, 0x31 },
{ CIMInputModeHanjaKeyModifier, &self->inputModeHanjaKeyModifier, NSAlternateKeyMask },
{ CIMInputModeHanjaKeyCode, &self->inputModeHanjaKeyCode, 0x24 },
{ CIMInputModeEnglishKeyModifier, &self->inputModeEnglishKeyModifier, 0 },
{ CIMInputModeEnglishKeyCode, &self->inputModeEnglishKeyCode, -1 },
{ CIMInputModeKoreanKeyModifier, &self->inputModeKoreanKeyModifier, 0 },
{ CIMInputModeKoreanKeyCode, &self->inputModeKoreanKeyCode, -1 },
{ CIMOptionKeyBehavior, &self->optionKeyBehavior, 0 },
{ CIMHangulCombinationModeComposing, &self->hangulCombinationModeComposing,
(NSInteger)HangulCharacterCombinationWithoutFiller },
@@ -278,15 +278,22 @@ @implementation CIMInputController (IMKServerInputHandleEvent)
// Receiving Events Directly from the Text Services Manager
- (BOOL)handleEvent:(NSEvent *)event client:(id)sender {
if ([event type] != NSKeyDown) {
dlog(DEBUG_LOGGING, @"LOGGING::NONKEYDOWN::%@/%@", event, sender);
dlog(DEBUG_INPUTCONTROLLER, @"** CIMInputController -handleEvent:client: with event: %@ / sender: %@", event, sender);
return NO;
if (event.type == NSKeyDown) {
dlog(DEBUG_INPUTCONTROLLER, @"** CIMInputController KEYDOWN -handleEvent:client: with event: %@ / key: %d / modifier: %lu / chars: %@ / chars ignoreMod: %@ / client: %@", event, [event keyCode], [event modifierFlags], [event characters], [event charactersIgnoringModifiers], [[self client] bundleIdentifier]);
BOOL processed = [self->_receiver inputController:self inputText:[event characters] key:[event keyCode] modifiers:[event modifierFlags] client:sender] > CIMInputTextProcessResultNotProcessed;
dlog(DEBUG_LOGGING, @"LOGGING::PROCESSED::%d", processed);
return processed;
}
dlog(DEBUG_INPUTCONTROLLER, @"** CIMInputController -handleEvent:client: with event: %@ / key: %d / modifier: %lu / chars: %@ / chars ignoreMod: %@ / client: %@", event, [event keyCode], [event modifierFlags], [event characters], [event charactersIgnoringModifiers], [[self client] bundleIdentifier]);
BOOL processed = [self->_receiver inputController:self inputText:[event characters] key:[event keyCode] modifiers:[event modifierFlags] client:sender] > CIMInputTextProcessResultNotProcessed;
dlog(DEBUG_LOGGING, @"LOGGING::PROCESSED::%d", processed);
return processed;
else if (event.type == NSFlagsChanged) {
// dlog(DEBUG_INPUTCONTROLLER, @"** CIMInputController FLAGCHANGED -handleEvent:client: with event: %@ / key: %d / modifier: %lu / chars: %@ / chars ignoreMod: %@ / client: %@", event, -1, [NSEvent modifierFlags], nil, nil, [[self client] bundleIdentifier]);
// BOOL processed = [self->_receiver inputController:self inputText:nil key:-1 modifiers:[NSEvent modifierFlags] client:sender] > CIMInputTextProcessResultNotProcessed;
// dlog(DEBUG_LOGGING, @"LOGGING::PROCESSED::%d", processed);
// return processed;
}
dlog(DEBUG_LOGGING, @"LOGGING::UNHANDLED::%@/%@", event, sender);
dlog(DEBUG_INPUTCONTROLLER, @"** CIMInputController -handleEvent:client: with event: %@ / sender: %@", event, sender);
return NO;
}
@end
@@ -67,7 +67,11 @@ - (CIMInputTextProcessResult)inputController:(CIMInputController *)controller in
dlog(TRUE, @"-- CIMInputHandler -inputText: Command/Option key input / returned NO");
return CIMInputTextProcessResultNotProcessedAndNeedsCommit;
}
if (string == nil) {
return CIMInputTextProcessResultNotProcessed;
}
result = [controller.composer inputController:controller inputText:string key:keyCode modifiers:flags client:sender];
finalize:
Oops, something went wrong.

0 comments on commit aa19d2a

Please sign in to comment.