| Framework | Carbon/Carbon.h |
| Declared in | Keyboards.h |
Keyboard Layout Services is the programming interface that lets you obtain information about available keyboard layouts, set a keyboard layout, and access a keyboard layout property list. Keyboard Layout Services fully supports Unicode ('uchr') as well as old style ('KCHR') keyboard layouts.
KBGetLayoutType
KLGetCurrentKeyboardLayout Deprecated in Mac OS X v10.5
KLGetKeyboardLayoutAtIndex Deprecated in Mac OS X v10.5
KLGetKeyboardLayoutCount Deprecated in Mac OS X v10.5
KLGetKeyboardLayoutProperty Deprecated in Mac OS X v10.5
KLGetKeyboardLayoutWithIdentifier Deprecated in Mac OS X v10.5
KLGetKeyboardLayoutWithName Deprecated in Mac OS X v10.5
KLSetCurrentKeyboardLayout Deprecated in Mac OS X v10.5
Obtains the type of keyboard attached to the computer.
PhysicalKeyboardLayoutType KBGetLayoutType ( SInt16 iKeyboardType );
The keyboard type ID of the keyboard whose type you want to obtain. You can obtain the keyboard type ID by calling the Event Manager function LMGetKbdType.
The type of the keyboard attached to the computer. See “Physical Keyboard Layout Types” for the values that can be returned.
You can call the function KBGetLayoutType to determine whether the keyboard attached to the computer is ANSI, ISO, or JIS. You should call this function in Mac OS 9 only if the Gestalt selector gestaltKeyboardLib is present.
Keyboards.h
Obtains the keyboard layout reference associated with the specified index.
Not supported.
OSStatus KLGetIndexedKeyboardLayout ( CFIndex iIndex, KeyboardLayoutRef * oKeyboardLayout );
You should use the function KLGetKeyboardLayoutAtIndex instead.
Keyboards.hSpecifies a reference to an opaque keyboard layout data structure.
typedef struct OpaqueKeyboardLayoutRef * KeyboardLayoutRef;
You can use the Keyboard Layout Services functions KLGetKeyboardLayoutAtIndex, KLGetKeyboardLayoutWithIdentifier, KLGetKeyboardLayoutWithName,or KLGetCurrentKeyboardLayout to
obtain a keyboard layout reference. If you want to obtain keyboard
layout data, use the function KLGetKeyboardLayoutProperty.
Keyboards.hSpecifies a layout identifier for a keyboard.
typedef SInt32 KeyboardLayoutIdentifier;
enum {
kKLUSKeyboard = 0
};
kKLUSKeyboardSpecifies a US keyboard layout. All systems support this keyboard layout.
Available in Mac OS X v10.2 and later.
Declared in Keyboards.h
You can supply this constant as the iIdentifier parameter
to the function KLGetKeyboardLayoutWithIdentifier.
This constant is the property value associated with the keyboard
layout property tag kKLIdentifier.
Specify the layout format used for a keyboard.
typedef SInt32 KeyboardLayoutKind;
enum {
kKLKCHRuchrKind = 0,
kKLKCHRKind = 1,
kKLuchrKind = 2
};
kKLKCHRuchrKindSpecifies that both 'KCHR' and 'uchr' formats
are available.
Available in Mac OS X v10.2 and later.
Declared in Keyboards.h
kKLKCHRKindSpecifies that only the 'KCHR' format
is available.
Available in Mac OS X v10.2 and later.
Declared in Keyboards.h
kKLuchrKindSpecifies that only the 'uchr' format
is available.
Available in Mac OS X v10.2 and later.
Declared in Keyboards.h
These values are associated with the keyboard layout property
tag kKLKind.
Specify the property tag for a keyboard layout.
typedef UInt32 KeyboardLayoutPropertyTag;
enum {
kKLKCHRData = 0,
kKLuchrData = 1,
kKLIdentifier = 2,
kKLIcon = 3,
kKLLocalizedName = 4,
kKLName = 5,
kKLGroupIdentifier = 6,
kKLKind = 7
};
kKLKCHRDataSpecifies 'KCHR' layout
format. The data associated with this tag is a pointer (const
void *) to keyboard layout data formatted
as 'KCHR' data. You can use 'KCHR'
data with the Event Manager function KeyTranslate.
Available in Mac OS X v10.2 and later.
Declared in Keyboards.h
kKLuchrDataSpecifies 'uchr' layout
format. The data associated with this tag is a pointer (const
void *) to keyboard layout data formatted
as 'uchr' data. You can use 'uchr' data
with the Unicode Utilities function UCKeyTranslate.
Available in Mac OS X v10.2 and later.
Declared in Keyboards.h
kKLIdentifierSpecifies a keyboard layout identifier. The data associated with this tag a “Keyboard Layout Identifier” constant.
Available in Mac OS X v10.2 and later.
Declared in Keyboards.h
kKLIconSpecifies a keyboard layout icon. The data
associated with this tag is an icon reference (IconRef)
that specifies the icon that appears in the Keyboard menu.
Available in Mac OS X v10.2 and later.
Declared in Keyboards.h
kKLLocalizedNameSpecifies the localized keyboard layout name.
The data associated with this tag is a CFStringRef that
specifies the localized name for the keyboard layout.
Available in Mac OS X v10.2 and later.
Declared in Keyboards.h
kKLNameSpecifies the keyboard layout name. The data
associated with this tag is a CFStringRef that
specifies the name for the keyboard layout.
Available in Mac OS X v10.2 and later.
Declared in Keyboards.h
kKLGroupIdentifierSpecifies the keyboard layout group identifier.
The data associated with this tag is an SInt32 value
that specifies the grouping of a keyboard layout in the Keyboard
menu.
Available in Mac OS X v10.2 and later.
Declared in Keyboards.h
kKLKindSpecifies the keyboard layout format. The data associated with this tag is a “Keyboard Layout Formats” constant.
Available in Mac OS X v10.2 and later.
Declared in Keyboards.h
You can supply any of these constants as the iPropertyTag parameter
to the function KLGetKeyboardLayoutProperty to
retrieve the data associated with the property tag.
Specify the layout type associated with a physical keyboard.
typedef UInt32 PhysicalKeyboardLayoutType;
enum {
kKeyboardJIS = 'JIS ',
kKeyboardANSI = 'ANSI',
kKeyboardISO = 'ISO ',
kKeyboardUnknown = kUnknownType
};
kKeyboardJISSpecifies a JIS keyboard.
Available in Mac OS X v10.0 and later.
Declared in Keyboards.h
kKeyboardANSISpecifies an ANSI keyboard layout.
Available in Mac OS X v10.0 and later.
Declared in Keyboards.h
kKeyboardISOSpecifies an ISO keyboard layout.
Available in Mac OS X v10.0 and later.
Declared in Keyboards.h
kKeyboardUnknownSpecifies the keyboard layout type is unknown.
Available in Mac OS X v10.0 and later.
Declared in Keyboards.h
These constants are returned by the function KBGetLayoutType.
Specifies a trap value for Keyboard Layout Services.
enum {
_KeyboardDispatch = 0xAA7A
};
This constant is not needed in Mac OS X.
Specify an error returned by unsupported PS2 keyboard functions.
enum {
errKBPS2KeyboardNotAvailable = -30850,
errKBIlligalParameters = -30851,
errKBFailSettingID = -30852,
errKBFailTranslationTable = -30853
errKBFailWritePreference = -30854
};
These constants are returned as error codes by the unsupported PS2 keyboard functions. They are not relevant to the functions whose prefix is ‘KL’.
Last updated: 2002-11-18