Re: Switching international keyboards programmatically
Re: Switching international keyboards programmatically
- Subject: Re: Switching international keyboards programmatically
- From: "Martin" <email@hidden>
- Date: Fri, 02 Dec 2005 18:08:57 -0800
On December 02 2005, Niko Matsakis <email@hidden> wrote:
>
Okay, I've done a little more snooping, and it appears that I need to
>
do something involving NSInputServers.
I don't think that will be necessary. Have you checked out these Carbon functions:
KeyScript
KLSetCurrentKeyboardLayout
They will allow you to modify the keyboard layout and script. (Tip: you will need to pass "smKeyForceKeyScriptMask" to KeyScript() in order to exit a unicode keyboard layout). Unfortunately they have some rather crippling limitations.
First, you cannot access all the input methods programmatically, eg: if you want Japanese you have no control over Katakana/Romanji/etc. It just picks the last one the user was working with. See radar://4164561.
In addition to that, sometimes the functions will silently fail. They always fail if the desired input method has not been included by the user on the menu already (radar://4164675). They also seem to fail in random scenarios that I cannot find a pattern to (radar://4164640). For instance, trying to change from the US keyboard layout to "KANA".
I have not found any workarounds, but haven't taken the time to ask around on the Carbon list. Let me know if you come up with anything.
~Martin
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden