Skip to content

Instantly share code, notes, and snippets.

@kmlawson
Last active November 25, 2015 23:48
Show Gist options
  • 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