home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection 1998 Fall: Game Toolkit / Disc.iso / SDKs / QuickTime Mac / PInterfaces / Keyboards.p < prev    next >
Encoding:
Text File  |  1998-04-09  |  3.8 KB  |  137 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        Keyboards.p
  3.  
  4.      Contains:    Keyboard API.
  5.  
  6.      Version:    Technology:    Keyboard 1.0
  7.                  Release:    QuickTime 3.0
  8.  
  9.      Copyright:    © 1997-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT Keyboards;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __KEYBOARDS__}
  28. {$SETC __KEYBOARDS__ := 1}
  29.  
  30. {$I+}
  31. {$SETC KeyboardsIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __MACTYPES__}
  35. {$I MacTypes.p}
  36. {$ENDC}
  37.  
  38.  
  39. {$PUSH}
  40. {$ALIGN MAC68K}
  41. {$LibExport+}
  42.  
  43. {——————————————————————————————————————————————————————————————————————————————————}
  44. { Keyboard API constants                                                            }
  45. {——————————————————————————————————————————————————————————————————————————————————}
  46. { Keyboard API Trap Number. Should be moved to Traps.i }
  47.  
  48. CONST
  49.     _KeyboardDispatch            = $AA7A;
  50.  
  51. { Gestalt selector and values for the Keyboard API }
  52.     gestaltKeyboardsAttr        = 'kbds';
  53.     gestaltKBPS2Keyboards        = 1;
  54.     gestaltKBPS2SetIDToAny        = 2;
  55.     gestaltKBPS2SetTranslationTable = 4;
  56.  
  57. { Keyboard API Error Codes }
  58. {
  59.    I stole the range blow from the empty space in the Allocation project but should
  60.    be updated to the officially registered range.
  61. }
  62.     errKBPS2KeyboardNotAvailable = -30850;
  63.     errKBIlligalParameters        = -30851;
  64.     errKBFailSettingID            = -30852;
  65.     errKBFailSettingTranslationTable = -30853;
  66.     errKBFailWritePreference    = -30854;
  67.  
  68.  
  69. { Keyboard HW Layout Types }
  70.     kKeyboardJIS                = 'JIS ';
  71.     kKeyboardANSI                = 'ANSI';
  72.     kKeyboardISO                = 'ISO ';
  73.     kKeyboardUnknown            = $3F3F3F3F;
  74.  
  75.  
  76. {——————————————————————————————————————————————————————————————————————————————————}
  77. { Keyboard API types                                                                }
  78. {——————————————————————————————————————————————————————————————————————————————————}
  79.  
  80.  
  81.  
  82. {——————————————————————————————————————————————————————————————————————————————————}
  83. { Keyboard API routines                                                            }
  84. {——————————————————————————————————————————————————————————————————————————————————}
  85.  
  86. FUNCTION KBInitialize: OSErr;
  87.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  88.     INLINE $303C, $0000, $AA7A;
  89.     {$ENDC}
  90. FUNCTION KBSetupPS2Keyboard(deviceID: INTEGER; alternativeTable: CStringPtr): OSErr;
  91.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  92.     INLINE $303C, $0001, $AA7A;
  93.     {$ENDC}
  94. FUNCTION KBGetPS2KeyboardID(VAR deviceID: INTEGER): OSErr;
  95.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  96.     INLINE $303C, $0002, $AA7A;
  97.     {$ENDC}
  98. FUNCTION KBIsPS2KeyboardConnected: BOOLEAN;
  99.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  100.     INLINE $303C, $0003, $AA7A;
  101.     {$ENDC}
  102. FUNCTION KBIsPS2KeyboardEnabled: BOOLEAN;
  103.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  104.     INLINE $303C, $0004, $AA7A;
  105.     {$ENDC}
  106. FUNCTION KBGetPS2KeyboardAttributes: LONGINT;
  107.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  108.     INLINE $303C, $0005, $AA7A;
  109.     {$ENDC}
  110. FUNCTION KBSetKCAPForPS2Keyboard(kcapHandle: Handle): OSErr;
  111.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  112.     INLINE $303C, $0006, $AA7A;
  113.     {$ENDC}
  114. FUNCTION KBGetLayoutType(deviceID: INTEGER): LONGINT;
  115.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  116.     INLINE $303C, $0007, $AA7A;
  117.     {$ENDC}
  118. FUNCTION KBSetupPS2KeyboardFromLayoutType(layoutType: OSType): OSErr;
  119.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  120.     INLINE $303C, $0008, $AA7A;
  121.     {$ENDC}
  122. FUNCTION KBGetPS2KeyboardLayoutType(VAR layoutType: OSType): OSErr;
  123.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  124.     INLINE $303C, $0009, $AA7A;
  125.     {$ENDC}
  126.  
  127. {$ALIGN RESET}
  128. {$POP}
  129.  
  130. {$SETC UsingIncludes := KeyboardsIncludes}
  131.  
  132. {$ENDC} {__KEYBOARDS__}
  133.  
  134. {$IFC NOT UsingIncludes}
  135.  END.
  136. {$ENDC}
  137.