Skip to content

Instantly share code, notes, and snippets.

@kmlawson
Last active November 25, 2015 23:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kmlawson/89a05c77063c2c350cf6 to your computer and use it in GitHub Desktop.
Save kmlawson/89a05c77063c2c350cf6 to your computer and use it in GitHub Desktop.
//
// main.m
// keyswitch
//
// Created by K. M. Lawson on 2015.11.25.
//
//
// com.apple.inputmethod.Korean.2SetKorean
// com.apple.inputmethod.Kotoeri.Japanese
// com.apple.inputmethod.TCIM.Pinyin
// com.apple.inputmethod.SCIM.ITABC
@import Carbon;
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
NSArray* sources = CFBridgingRelease(TISCreateInputSourceList((__bridge CFDictionaryRef)@{ (__bridge NSString*)kTISPropertyInputSourceID : @"com.apple.inputmethod.SCIM.ITABC" }, FALSE));
TISInputSourceRef source = (__bridge TISInputSourceRef)sources[0];
OSStatus status = TISSelectInputSource(source);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment