< Previous PageNext Page > Hide TOC

Deprecated Keyboard Layout Services Functions

A function identified as deprecated has been superseded and may become unsupported in the future.

Deprecated in Mac OS X v10.5

KLGetCurrentKeyboardLayout

Obtains the keyboard layout for the layout currently selected in the Keyboards menu. (Deprecated in Mac OS X v10.5.)

OSStatus KLGetCurrentKeyboardLayout (
   KeyboardLayoutRef *oKeyboardLayout
);

Parameters
oKeyboardLayout

On output, a pointer to the keyboard layout reference for keyboard layout currently selected in the Keyboard menu.

Return Value

A result code.

Availability
Declared In
Keyboards.h

KLGetKeyboardLayoutAtIndex

Obtains the keyboard layout reference associated with the specified index. (Deprecated in Mac OS X v10.5.)

OSStatus KLGetKeyboardLayoutAtIndex (
   CFIndex iIndex,
   KeyboardLayoutRef *oKeyboardLayout
);

Parameters
iIndex

The index of the keyboard layout whose keyboard layout reference you want to retrieve. The index must be a value from 0 through N-1, where N is the value returned in the oCount parameter by the function KLGetKeyboardLayoutCount.

oKeyboardLayout

On output, a pointer to the keyboard layout reference associated with the index specified by the iIndex parameter.

Return Value

A result code.

Discussion

You can call this function from within an iteration to access all of the available keyboard layouts.

Availability
Declared In
Keyboards.h

KLGetKeyboardLayoutCount

Returns the number of keyboard layouts. (Deprecated in Mac OS X v10.5.)

OSStatus KLGetKeyboardLayoutCount (
   CFIndex *oCount
);

Parameters
oCount

On output, a pointer to a variable that specifies the number of keyboard layouts.

Return Value

A result code.

Discussion

You can call the function KLGetKeyboardLayoutCount when you want to obtain the number of keyboard layouts available to the user. Once you know the number of keyboard layouts, you can iterate through them by setting up a loop and calling the function KLGetKeyboardLayoutAtIndex.

Availability
Declared In
Keyboards.h

KLGetKeyboardLayoutProperty

Obtains the value associated with the specified property tag for a keyboard layout. (Deprecated in Mac OS X v10.5.)

OSStatus KLGetKeyboardLayoutProperty (
   KeyboardLayoutRef iKeyboardLayout,
   KeyboardLayoutPropertyTag iPropertyTag,
   const void **oValue
);

Parameters
iKeyboardLayout

A keyboard layout reference for the keyboard layout whose property value you want to retrieve. You must pass a valid keyboard layout reference. You can obtain a keyboard layout reference by calling the functions KLGetKeyboardLayoutAtIndex, KLGetKeyboardLayoutWithIdentifier, KLGetKeyboardLayoutWithName,or KLGetCurrentKeyboardLayout.

iPropertyTag

A keyboard layout property tag that specifies the property whose value you want to retrieve. See “Keyboard Layout Property Tag” for a list of the property tag constants you can supply.

oValue

On output, a pointer to the variable associated with the tag specified by the iPropertyTag parameter.

Return Value

A result code.

Discussion

You can use this function to obtain keyboard layout data, the keyboard identifier, the icon used for the keyboard menu, the keyboard layout name (including its localized name), the group identifier, and the keyboard layout kind. See “Keyboard Layout Property Tag” for a complete list of the available property tags.

Availability
Declared In
Keyboards.h

KLGetKeyboardLayoutWithIdentifier

Obtains the keyboard layout reference associated with the specified identifier. (Deprecated in Mac OS X v10.5.)

OSStatus KLGetKeyboardLayoutWithIdentifier (
   KeyboardLayoutIdentifier iIdentifier,
   KeyboardLayoutRef *oKeyboardLayout
);

Parameters
iIdentifier

The keyboard layout identifier for which you want to obtain a keyboard layout reference. See “Keyboard Layout Identifier” for a list of the constants you can supply.

oKeyboardLayout

On output, a pointer to the keyboard layout reference associated with the identifier specified by the iIdentifer parameter.

Return Value

A result code.

Availability
Declared In
Keyboards.h

KLGetKeyboardLayoutWithName

Obtains the keyboard layout associated with the specified name. (Deprecated in Mac OS X v10.5.)

OSStatus KLGetKeyboardLayoutWithName (
   CFStringRef iName,
   KeyboardLayoutRef *oKeyboardLayout
);

Parameters
iName

A CFStringRef that specifies the name of the keyboard layout whose keyboard layout reference you want to obtain. This name is the nonlocalized keyboard layout name.

oKeyboardLayout

On output, a pointer to the keyboard layout reference associated with the name specified by the iName parameter.

Return Value

A result code.

Discussion

You can call this function when you want to obtain the keyboard layout reference for a keyboard layout other than the active keyboard layout. If you want to obtain the keyboard layout reference for the active keyboard layout, call the function KLGetCurrentKeyboardLayout.

Availability
Declared In
Keyboards.h

KLSetCurrentKeyboardLayout

Sets the keyboard layout. (Deprecated in Mac OS X v10.5.)

OSStatus KLSetCurrentKeyboardLayout (
   KeyboardLayoutRef iKeyboardLayout
);

Parameters
iKeyboardLayout

A keyboard layout reference for the keyboard layout you want to set. You must pass a valid keyboard layout reference. You can obtain a keyboard layout reference by calling the functions KLGetKeyboardLayoutAtIndex, KLGetKeyboardLayoutWithIdentifier, KLGetKeyboardLayoutWithName,or KLGetCurrentKeyboardLayout.

Return Value

A result code.

Availability
Declared In
Keyboards.h

< Previous PageNext Page > Hide TOC


© 2002 Apple Computer, Inc. All Rights Reserved. (Last updated: 2002-11-18)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.