Keyboards.pas 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621
  1. {
  2. File: HIToolbox/Keyboards.h
  3. Contains: Keyboard API.
  4. Version: HIToolbox-219.4.81~2
  5. Copyright: © 1997-2005 by Apple Computer, Inc., all rights reserved
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://www.freepascal.org/bugs.html
  9. }
  10. { Pascal Translation Updated: Peter N Lewis, <[email protected]>, August 2005 }
  11. {
  12. Modified for use with Free Pascal
  13. Version 200
  14. Please report any bugs to <[email protected]>
  15. }
  16. {$mode macpas}
  17. {$packenum 1}
  18. {$macro on}
  19. {$inline on}
  20. {$CALLING MWPASCAL}
  21. unit Keyboards;
  22. interface
  23. {$setc UNIVERSAL_INTERFACES_VERSION := $0342}
  24. {$setc GAP_INTERFACES_VERSION := $0200}
  25. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  26. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  27. {$endc}
  28. {$ifc defined CPUPOWERPC and defined CPUI386}
  29. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  30. {$endc}
  31. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  32. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  33. {$endc}
  34. {$ifc not defined __ppc__ and defined CPUPOWERPC}
  35. {$setc __ppc__ := 1}
  36. {$elsec}
  37. {$setc __ppc__ := 0}
  38. {$endc}
  39. {$ifc not defined __i386__ and defined CPUI386}
  40. {$setc __i386__ := 1}
  41. {$elsec}
  42. {$setc __i386__ := 0}
  43. {$endc}
  44. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  45. {$error Conflicting definitions for __ppc__ and __i386__}
  46. {$endc}
  47. {$ifc defined __ppc__ and __ppc__}
  48. {$setc TARGET_CPU_PPC := TRUE}
  49. {$setc TARGET_CPU_X86 := FALSE}
  50. {$elifc defined __i386__ and __i386__}
  51. {$setc TARGET_CPU_PPC := FALSE}
  52. {$setc TARGET_CPU_X86 := TRUE}
  53. {$elsec}
  54. {$error Neither __ppc__ nor __i386__ is defined.}
  55. {$endc}
  56. {$setc TARGET_CPU_PPC_64 := FALSE}
  57. {$ifc defined FPC_BIG_ENDIAN}
  58. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  59. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  60. {$elifc defined FPC_LITTLE_ENDIAN}
  61. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  62. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  63. {$elsec}
  64. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  65. {$endc}
  66. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  67. {$setc CALL_NOT_IN_CARBON := FALSE}
  68. {$setc OLDROUTINENAMES := FALSE}
  69. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  70. {$setc OPAQUE_UPP_TYPES := TRUE}
  71. {$setc OTCARBONAPPLICATION := TRUE}
  72. {$setc OTKERNEL := FALSE}
  73. {$setc PM_USE_SESSION_APIS := TRUE}
  74. {$setc TARGET_API_MAC_CARBON := TRUE}
  75. {$setc TARGET_API_MAC_OS8 := FALSE}
  76. {$setc TARGET_API_MAC_OSX := TRUE}
  77. {$setc TARGET_CARBON := TRUE}
  78. {$setc TARGET_CPU_68K := FALSE}
  79. {$setc TARGET_CPU_MIPS := FALSE}
  80. {$setc TARGET_CPU_SPARC := FALSE}
  81. {$setc TARGET_OS_MAC := TRUE}
  82. {$setc TARGET_OS_UNIX := FALSE}
  83. {$setc TARGET_OS_WIN32 := FALSE}
  84. {$setc TARGET_RT_MAC_68881 := FALSE}
  85. {$setc TARGET_RT_MAC_CFM := FALSE}
  86. {$setc TARGET_RT_MAC_MACHO := TRUE}
  87. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  88. {$setc TYPE_BOOL := FALSE}
  89. {$setc TYPE_EXTENDED := FALSE}
  90. {$setc TYPE_LONGLONG := TRUE}
  91. uses MacTypes, CFBase;
  92. {$ALIGN POWER}
  93. {ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ}
  94. { OBSOLETE }
  95. {ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ}
  96. { These are obsolete. Carbon does not support these. }
  97. { Keyboard API Trap Number. Should be moved to Traps.i }
  98. const
  99. _KeyboardDispatch = $AA7A;
  100. { Gestalt selector and values for the Keyboard API }
  101. const
  102. gestaltKeyboardsAttr = $6B626473 (* 'kbds' *);
  103. gestaltKBPS2Keyboards = 1;
  104. gestaltKBPS2SetIDToAny = 2;
  105. gestaltKBPS2SetTranslationTable = 4;
  106. { Keyboard API Error Codes }
  107. {
  108. I stole the range blow from the empty space in the Allocation project but should
  109. be updated to the officially registered range.
  110. }
  111. const
  112. errKBPS2KeyboardNotAvailable = -30850;
  113. errKBIlligalParameters = -30851;
  114. errKBFailSettingID = -30852;
  115. errKBFailSettingTranslationTable = -30853;
  116. errKBFailWritePreference = -30854;
  117. {
  118. * KBInitialize()
  119. *
  120. * Availability:
  121. * Mac OS X: not available
  122. * CarbonLib: not available
  123. * Non-Carbon CFM: in KeyboardsLib 1.0 and later
  124. }
  125. {
  126. * KBSetupPS2Keyboard()
  127. *
  128. * Availability:
  129. * Mac OS X: not available
  130. * CarbonLib: not available
  131. * Non-Carbon CFM: in KeyboardsLib 1.0 and later
  132. }
  133. {
  134. * KBGetPS2KeyboardID()
  135. *
  136. * Availability:
  137. * Mac OS X: not available
  138. * CarbonLib: not available
  139. * Non-Carbon CFM: in KeyboardsLib 1.0 and later
  140. }
  141. {
  142. * KBIsPS2KeyboardConnected()
  143. *
  144. * Availability:
  145. * Mac OS X: not available
  146. * CarbonLib: not available
  147. * Non-Carbon CFM: in KeyboardsLib 1.0 and later
  148. }
  149. {
  150. * KBIsPS2KeyboardEnabled()
  151. *
  152. * Availability:
  153. * Mac OS X: not available
  154. * CarbonLib: not available
  155. * Non-Carbon CFM: in KeyboardsLib 1.0 and later
  156. }
  157. {
  158. * KBGetPS2KeyboardAttributes()
  159. *
  160. * Availability:
  161. * Mac OS X: not available
  162. * CarbonLib: not available
  163. * Non-Carbon CFM: in KeyboardsLib 1.0 and later
  164. }
  165. {
  166. * KBSetKCAPForPS2Keyboard()
  167. *
  168. * Availability:
  169. * Mac OS X: not available
  170. * CarbonLib: not available
  171. * Non-Carbon CFM: in KeyboardsLib 1.0 and later
  172. }
  173. {
  174. * KBSetupPS2KeyboardFromLayoutType()
  175. *
  176. * Availability:
  177. * Mac OS X: not available
  178. * CarbonLib: not available
  179. * Non-Carbon CFM: in KeyboardsLib 1.0 and later
  180. }
  181. {
  182. * KBGetPS2KeyboardLayoutType()
  183. *
  184. * Availability:
  185. * Mac OS X: not available
  186. * CarbonLib: not available
  187. * Non-Carbon CFM: in KeyboardsLib 1.0 and later
  188. }
  189. {ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ}
  190. { Keyboard API constants }
  191. {ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ}
  192. {
  193. * PhysicalKeyboardLayoutType
  194. *
  195. * Summary:
  196. * Physical keyboard layout types indicate the physical keyboard
  197. * layout. They are returned by the KBGetLayoutType API.
  198. }
  199. type
  200. PhysicalKeyboardLayoutType = UInt32;
  201. const
  202. {
  203. * A JIS keyboard layout type.
  204. }
  205. kKeyboardJIS = $4A495320 (* 'JIS ' *);
  206. {
  207. * An ANSI keyboard layout type.
  208. }
  209. kKeyboardANSI = $414E5349 (* 'ANSI' *);
  210. {
  211. * An ISO keyboard layout type.
  212. }
  213. kKeyboardISO = $49534F20 (* 'ISO ' *);
  214. {
  215. * An unknown physical keyboard layout type.
  216. }
  217. kKeyboardUnknown = kUnknownType; { '????'}
  218. {ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ}
  219. { Keyboard API types }
  220. {ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ}
  221. {
  222. * KeyboardLayoutRef
  223. *
  224. * Summary:
  225. * The opaque keyboard layout contains information about a keyboard
  226. * layout. It is used with the keyboard layout APIs.
  227. *
  228. * Discussion:
  229. * KeyboardLayoutRef APIs follow CoreFoundation function naming
  230. * convention. You mustn't release any references you get from APIs
  231. * named "Get."
  232. }
  233. type
  234. KeyboardLayoutRef = ^SInt32; { an opaque 32-bit type }
  235. {
  236. * KeyboardLayoutPropertyTag
  237. *
  238. * Summary:
  239. * Keyboard layout property tags specify the value you want to
  240. * retrieve. They are used with the KLGetKeyboardLayoutProperty API.
  241. }
  242. type
  243. KeyboardLayoutPropertyTag = UInt32;
  244. const
  245. {
  246. * The keyboard layout data (const void *). It is used with the
  247. * KeyTranslate API.
  248. }
  249. kKLKCHRData = 0;
  250. {
  251. * The keyboard layout data (const void *). It is used with the
  252. * UCKeyTranslate API.
  253. }
  254. kKLuchrData = 1;
  255. {
  256. * The keyboard layout identifier (KeyboardLayoutIdentifier).
  257. }
  258. kKLIdentifier = 2;
  259. {
  260. * The keyboard layout icon (IconRef).
  261. }
  262. kKLIcon = 3;
  263. {
  264. * The localized keyboard layout name (CFStringRef).
  265. }
  266. kKLLocalizedName = 4;
  267. {
  268. * The keyboard layout name (CFStringRef).
  269. }
  270. kKLName = 5;
  271. {
  272. * The keyboard layout group identifier (SInt32).
  273. }
  274. kKLGroupIdentifier = 6;
  275. {
  276. * The keyboard layout kind (KeyboardLayoutKind).
  277. }
  278. kKLKind = 7;
  279. {
  280. * The language/locale string associated with the keyboard, if any
  281. * (CFStringRef). This string uses ISO 639 and ISO 3166 codes
  282. * (examples: "fr", "en_US". Note: The CFStringRef may be NULL for
  283. * some keyboards.
  284. }
  285. kKLLanguageCode = 9;
  286. {
  287. * KeyboardLayoutKind
  288. *
  289. * Summary:
  290. * Keyboard layout kinds indicate available keyboard layout formats.
  291. }
  292. type
  293. KeyboardLayoutKind = SInt32;
  294. const
  295. {
  296. * Both KCHR and uchr formats are available.
  297. }
  298. kKLKCHRuchrKind = 0;
  299. {
  300. * Only KCHR format is avaiable.
  301. }
  302. kKLKCHRKind = 1;
  303. {
  304. * Only uchr format is available.
  305. }
  306. kKLuchrKind = 2;
  307. {
  308. * KeyboardLayoutIdentifier
  309. *
  310. * Summary:
  311. * Keyboard layout identifiers specify particular keyboard layouts.
  312. }
  313. type
  314. KeyboardLayoutIdentifier = SInt32;
  315. const
  316. kKLUSKeyboard = 0;
  317. {ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ}
  318. { Keyboard API routines }
  319. {ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ}
  320. {
  321. * KBGetLayoutType()
  322. *
  323. * Summary:
  324. * Returns the physical keyboard layout type.
  325. *
  326. * Mac OS X threading:
  327. * Not thread safe
  328. *
  329. * Parameters:
  330. *
  331. * iKeyboardType:
  332. * The keyboard type ID. LMGetKbdType().
  333. *
  334. * Availability:
  335. * Mac OS X: in version 10.0 and later in Carbon.framework
  336. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  337. * Non-Carbon CFM: in KeyboardsLib 1.0 and later
  338. }
  339. function KBGetLayoutType( iKeyboardType: SInt16 ): PhysicalKeyboardLayoutType; external name '_KBGetLayoutType';
  340. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  341. { iterate keyboard layouts}
  342. {
  343. * KLGetKeyboardLayoutCount()
  344. *
  345. * Summary:
  346. * Returns the number of keyboard layouts.
  347. *
  348. * Mac OS X threading:
  349. * Not thread safe
  350. *
  351. * Parameters:
  352. *
  353. * oCount:
  354. * On exit, the number of keyboard layouts
  355. *
  356. * Availability:
  357. * Mac OS X: in version 10.2 and later in Carbon.framework
  358. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  359. * Non-Carbon CFM: not available
  360. }
  361. function KLGetKeyboardLayoutCount( var oCount: CFIndex ): OSStatus; external name '_KLGetKeyboardLayoutCount';
  362. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  363. {
  364. * KLGetKeyboardLayoutAtIndex()
  365. *
  366. * Summary:
  367. * Retrieves the keyboard layout at the given index.
  368. *
  369. * Mac OS X threading:
  370. * Not thread safe
  371. *
  372. * Parameters:
  373. *
  374. * iIndex:
  375. * The index of the keyboard layout to retrieve. If the index is
  376. * outside the index space of the keyboard layouts (0 to N-1
  377. * inclusive, where N is the count of the keyboard layouts), the
  378. * behavior is undefined.
  379. *
  380. * oKeyboardLayout:
  381. * On exit, the keyboard layout with the given index.
  382. *
  383. * Availability:
  384. * Mac OS X: in version 10.2 and later in Carbon.framework
  385. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  386. * Non-Carbon CFM: not available
  387. }
  388. function KLGetKeyboardLayoutAtIndex( iIndex: CFIndex; var oKeyboardLayout: KeyboardLayoutRef ): OSStatus; external name '_KLGetKeyboardLayoutAtIndex';
  389. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  390. {
  391. *** deprecated. ***
  392. NOTE: "Indexed" is a wrong name, please use "AtIndex"...
  393. OSStatus KLGetIndexedKeyboardLayout(
  394. CFIndex iIndex,
  395. KeyboardLayoutRef *oKeyboardLayout );
  396. }
  397. { get keyboard layout info}
  398. {
  399. * KLGetKeyboardLayoutProperty()
  400. *
  401. * Summary:
  402. * Retrives property value for the given keyboard layout and tag.
  403. *
  404. * Mac OS X threading:
  405. * Not thread safe
  406. *
  407. * Parameters:
  408. *
  409. * iKeyboardLayout:
  410. * The keyboard layout to be queried. If this parameter is not a
  411. * valid KeyboardLayoutRef, the behavior is undefined.
  412. *
  413. * iPropertyTag:
  414. * The property tag.
  415. *
  416. * oValue:
  417. * On exit, the property value for the given keyboard layout and
  418. * tag.
  419. *
  420. * Availability:
  421. * Mac OS X: in version 10.2 and later in Carbon.framework
  422. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  423. * Non-Carbon CFM: not available
  424. }
  425. function KLGetKeyboardLayoutProperty( iKeyboardLayout: KeyboardLayoutRef; iPropertyTag: KeyboardLayoutPropertyTag; var oValue: UnivPtr ): OSStatus; external name '_KLGetKeyboardLayoutProperty';
  426. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  427. { get keyboard layout with identifier or name}
  428. {
  429. * KLGetKeyboardLayoutWithIdentifier()
  430. *
  431. * Summary:
  432. * Retrieves the keyboard layout with the given identifier.
  433. *
  434. * Discussion:
  435. * For now, the identifier is in the range of SInt16 which is
  436. * compatible with the Resource Manager resource ID. However, it
  437. * will become an arbitrary SInt32 value at some point, so do not
  438. * assume it is in SInt16 range or falls into the "script range" of
  439. * the resource IDs.
  440. *
  441. * Mac OS X threading:
  442. * Not thread safe
  443. *
  444. * Parameters:
  445. *
  446. * iIdentifier:
  447. * The keyboard layout identifier.
  448. *
  449. * oKeyboardLayout:
  450. * On exit, the keyboard layout with the given identifier.
  451. *
  452. * Availability:
  453. * Mac OS X: in version 10.2 and later in Carbon.framework
  454. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  455. * Non-Carbon CFM: not available
  456. }
  457. function KLGetKeyboardLayoutWithIdentifier( iIdentifier: KeyboardLayoutIdentifier; var oKeyboardLayout: KeyboardLayoutRef ): OSStatus; external name '_KLGetKeyboardLayoutWithIdentifier';
  458. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  459. {
  460. * KLGetKeyboardLayoutWithName()
  461. *
  462. * Summary:
  463. * Retrieves the keyboard layout with the given name.
  464. *
  465. * Mac OS X threading:
  466. * Not thread safe
  467. *
  468. * Parameters:
  469. *
  470. * iName:
  471. * The keyboard layout name.
  472. *
  473. * oKeyboardLayout:
  474. * On exit, the keyboard layout with the given name.
  475. *
  476. * Availability:
  477. * Mac OS X: in version 10.2 and later in Carbon.framework
  478. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  479. * Non-Carbon CFM: not available
  480. }
  481. function KLGetKeyboardLayoutWithName( iName: CFStringRef; var oKeyboardLayout: KeyboardLayoutRef ): OSStatus; external name '_KLGetKeyboardLayoutWithName';
  482. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  483. { get/set current keyboard layout of the current group identifier}
  484. {
  485. * KLGetCurrentKeyboardLayout()
  486. *
  487. * Summary:
  488. * Retrieves the current keyboard layout.
  489. *
  490. * Discussion:
  491. * Retrieves the current keyboard layout for the current keyboard
  492. * script. To retrive the current keyboard script for Roman
  493. * keyboard script, you need to call KeyScript( smRoman |
  494. * smKeyForceKeyScriptMask ) then call KLGetCurrentKeyboardLayout().
  495. *
  496. * Mac OS X threading:
  497. * Not thread safe
  498. *
  499. * Parameters:
  500. *
  501. * oKeyboardLayout:
  502. * On exit, the current keyboard layout.
  503. *
  504. * Availability:
  505. * Mac OS X: in version 10.2 and later in Carbon.framework
  506. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  507. * Non-Carbon CFM: not available
  508. }
  509. function KLGetCurrentKeyboardLayout( var oKeyboardLayout: KeyboardLayoutRef ): OSStatus; external name '_KLGetCurrentKeyboardLayout';
  510. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  511. {
  512. * KLSetCurrentKeyboardLayout()
  513. *
  514. * Summary:
  515. * Sets the current keyboard layout.
  516. *
  517. * Discussion:
  518. * Sets the current keyboard layout for the current keyboard script.
  519. * Returns "paramErr" when the current keyboard layout is not
  520. * Unicode and the specified keyboard layout belongs to Unicode
  521. * group. To set Roman keyboard script's current keyboard layout to
  522. * "U.S." for example, you need to call KeyScript( smRoman |
  523. * smKeyForceKeyScriptMask ) then call KLSetCurrentKeyboardLayout(
  524. * theUSKeyboardLayoutRef ).
  525. *
  526. * Mac OS X threading:
  527. * Not thread safe
  528. *
  529. * Parameters:
  530. *
  531. * iKeyboardLayout:
  532. * The keyboard layout.
  533. *
  534. * Availability:
  535. * Mac OS X: in version 10.2 and later in Carbon.framework
  536. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  537. * Non-Carbon CFM: not available
  538. }
  539. function KLSetCurrentKeyboardLayout( iKeyboardLayout: KeyboardLayoutRef ): OSStatus; external name '_KLSetCurrentKeyboardLayout';
  540. (* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER *)
  541. end.