List of keyboard layouts

  • Hello,

    How to retrieve list of active language layouts?
    I have U.S., Russian and French layouts in my layouts menu, but pair
    KLGetKeyboardLayoutCount/KLGetKeyboardLayoutAtIndex returns all
    layouts from SysPrefs/International.

    And how to retrieve _current_ layout name?
    When I'm using KLGetCurrentKeyboardLayout( &layout ), when
    KLGetKeyboardLayoutProperty with kKLName, result always same: "U.S.",
    even if current layout is Hiragana or Russian.

    ...---...
    SOS!

    Thanks.
  • I'm afraid there is no way to get the set of enabled keyboards in
    currently shipping versions of Mac OS X. This is planned to be
    addressed in a future version of Mac OS X.

    I think you want kKLLocalizedName, not kKLName. However, you
    shouldn't always be getting "U.S." Please file a bug.

    Deborah Goldsmith
    Internationalization, Unicode liaison
    Apple Inc.
    <goldsmit...>

    On Jun 26, 2007, at 5:38 AM, <gebiet...> wrote:

    > Hello,
    >
    > How to retrieve list of active language layouts?
    > I have U.S., Russian and French layouts in my layouts menu, but pair
    > KLGetKeyboardLayoutCount/KLGetKeyboardLayoutAtIndex returns all
    > layouts from SysPrefs/International.
    >
    > And how to retrieve _current_ layout name?
    > When I'm using KLGetCurrentKeyboardLayout( &layout ), when
    > KLGetKeyboardLayoutProperty with kKLName, result always same: "U.S.",
    > even if current layout is Hiragana or Russian.
    >
    > ...---...
    > SOS!
    >
    > Thanks.
  • > I'm afraid there is no way to get the set of enabled keyboards in
    > currently shipping versions of Mac OS X. This is planned to be
    > addressed in a future version of Mac OS X.

    Ok, but where is this info stored?

    > I think you want kKLLocalizedName, not kKLName. However, you
    > shouldn't always be getting "U.S." Please file a bug.

    Sorry, all working fine in one application.
    I need to retrieve current keyboard layout from hidden application. In
    other words, I need layout, which selected in system menu, near clock.
    As I guess, KLGetCurrentKeyboardLayout returns keyboard layout,
    selected for my application? How I can retrieve current layout
    system-wide?

    Here is thread code:

    -(void)testLayout:(id)param
    {
    while(true)
    {
      KeyboardLayoutRef theCurrentLayout;
      NSString *layoutName;

      KLGetCurrentKeyboardLayout(&theCurrentLayout);
      KLGetKeyboardLayoutProperty( theCurrentLayout, kKLLocalizedName,
    (const void **)&layoutName );
      NSLog( @"Current layout: %@", layoutName );

      sleep( 1 );
    }
    }
  • On Jun 27, 2007, at 3:46 AM, <gebiet...> wrote:

    >> I'm afraid there is no way to get the set of enabled keyboards in
    >> currently shipping versions of Mac OS X. This is planned to be
    >> addressed in a future version of Mac OS X.
    >
    > Ok, but where is this info stored?

    Apple does not support access to this information in shipping
    versions of Mac OS X.

    >
    >> I think you want kKLLocalizedName, not kKLName. However, you
    >> shouldn't always be getting "U.S." Please file a bug.
    >
    > Sorry, all working fine in one application.
    > I need to retrieve current keyboard layout from hidden application. In
    > other words, I need layout, which selected in system menu, near clock.
    > As I guess, KLGetCurrentKeyboardLayout returns keyboard layout,
    > selected for my application? How I can retrieve current layout
    > system-wide?
    >
    > Here is thread code:
    >
    > -(void)testLayout:(id)param
    > {
    > while(true)
    > {
    > KeyboardLayoutRef theCurrentLayout;
    > NSString *layoutName;
    >
    > KLGetCurrentKeyboardLayout(&theCurrentLayout);
    > KLGetKeyboardLayoutProperty( theCurrentLayout, kKLLocalizedName,
    > (const void **)&layoutName );
    > NSLog( @"Current layout: %@", layoutName );
    >
    > sleep( 1 );
    > }
    > }

    There is only one current keyboard layout accessible at any given
    time in currently shipping versions of Mac OS X. If you have "Allow a
    different input source for each document" enabled in International
    Preferences, there is no way to find out which input source is
    selected for other documents.

    Deborah Goldsmith
    Internationalization, Unicode liaison
    Apple Inc.
    <goldsmit...>
  • > There is only one current keyboard layout accessible at any given
    > time in currently shipping versions of Mac OS X. If you have "Allow a
    > different input source for each document" enabled in International
    > Preferences, there is no way to find out which input source is
    > selected for other documents.

    But how TextInput.menu menu extra detects a) active (user selectable)
    languages b) current language in any program?
  • Sorry, I have just not had time to keep up with this list. I'm slowly
    catching up.

    The Text Input Menu and the Text Services Manager communicate via a
    private protocol. There is no public API for doing this in currently
    shipping versions of Mac OS X. That may change in a future release.

    Deborah Goldsmith
    Internationalization, Unicode Liaison
    Apple Inc.
    <goldsmit...>

    On Aug 23, 2007, at 7:10 AM, <gebiet...> wrote:

    >> There is only one current keyboard layout accessible at any given
    >> time in currently shipping versions of Mac OS X. If you have "Allow a
    >> different input source for each document" enabled in International
    >> Preferences, there is no way to find out which input source is
    >> selected for other documents.
    >
    > But how TextInput.menu menu extra detects a) active (user selectable)
    > languages b) current language in any program?
previous month june 2007 next month
MTWTFSS
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30  
Go to today