• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Switching international keyboards programmatically
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Switching international keyboards programmatically
      • From: Niko Matsakis <email@hidden>
  • Prev by Date: Re: binding to a controller not in my nib, how?
  • Next by Date: Re: binding to a controller not in my nib, how?
  • Previous by thread: Re: Switching international keyboards programmatically
  • Next by thread: Re: Switching international keyboards programmatically
  • Index(es):
    • Date
    • Thread