Skip to content

Instantly share code, notes, and snippets.

@ctrngk
Forked from bofh/SwitchToEnglish.m
Created October 9, 2018 10:27
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 ctrngk/e1a334ffce1489e7ad2f15b7b46fe826 to your computer and use it in GitHub Desktop.
Save ctrngk/e1a334ffce1489e7ad2f15b7b46fe826 to your computer and use it in GitHub Desktop.
/* Trivial keyboard input layout to english switcher by Alexander V. Zhouravlev.
* Compile it with gcc -framework Carbon -o SwitchToEnglish SwitchToEnglish.m */
#import <Carbon/Carbon.h>
int main (int argc, const char *argv[])
{
TISInputSourceRef english = TISCopyInputSourceForLanguage(CFSTR("en-US"));
if (!english)
return 1;
return ((noErr == TISSelectInputSource(english))?0:2);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment