home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-04-09 | 3.8 KB | 137 lines | [TEXT/MPS ] |
- {
- File: Keyboards.p
-
- Contains: Keyboard API.
-
- Version: Technology: Keyboard 1.0
- Release: QuickTime 3.0
-
- Copyright: © 1997-1998 by Apple Computer, Inc., all rights reserved
-
- Bugs?: Please include the the file and version information (from above) with
- the problem description. Developers belonging to one of the Apple
- developer programs can submit bug reports to:
-
- devsupport@apple.com
-
- }
- {$IFC UNDEFINED UsingIncludes}
- {$SETC UsingIncludes := 0}
- {$ENDC}
-
- {$IFC NOT UsingIncludes}
- UNIT Keyboards;
- INTERFACE
- {$ENDC}
-
- {$IFC UNDEFINED __KEYBOARDS__}
- {$SETC __KEYBOARDS__ := 1}
-
- {$I+}
- {$SETC KeyboardsIncludes := UsingIncludes}
- {$SETC UsingIncludes := 1}
-
- {$IFC UNDEFINED __MACTYPES__}
- {$I MacTypes.p}
- {$ENDC}
-
-
- {$PUSH}
- {$ALIGN MAC68K}
- {$LibExport+}
-
- {——————————————————————————————————————————————————————————————————————————————————}
- { Keyboard API constants }
- {——————————————————————————————————————————————————————————————————————————————————}
- { Keyboard API Trap Number. Should be moved to Traps.i }
-
- CONST
- _KeyboardDispatch = $AA7A;
-
- { Gestalt selector and values for the Keyboard API }
- gestaltKeyboardsAttr = 'kbds';
- gestaltKBPS2Keyboards = 1;
- gestaltKBPS2SetIDToAny = 2;
- gestaltKBPS2SetTranslationTable = 4;
-
- { Keyboard API Error Codes }
- {
- I stole the range blow from the empty space in the Allocation project but should
- be updated to the officially registered range.
- }
- errKBPS2KeyboardNotAvailable = -30850;
- errKBIlligalParameters = -30851;
- errKBFailSettingID = -30852;
- errKBFailSettingTranslationTable = -30853;
- errKBFailWritePreference = -30854;
-
-
- { Keyboard HW Layout Types }
- kKeyboardJIS = 'JIS ';
- kKeyboardANSI = 'ANSI';
- kKeyboardISO = 'ISO ';
- kKeyboardUnknown = $3F3F3F3F;
-
-
- {——————————————————————————————————————————————————————————————————————————————————}
- { Keyboard API types }
- {——————————————————————————————————————————————————————————————————————————————————}
-
-
-
- {——————————————————————————————————————————————————————————————————————————————————}
- { Keyboard API routines }
- {——————————————————————————————————————————————————————————————————————————————————}
-
- FUNCTION KBInitialize: OSErr;
- {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
- INLINE $303C, $0000, $AA7A;
- {$ENDC}
- FUNCTION KBSetupPS2Keyboard(deviceID: INTEGER; alternativeTable: CStringPtr): OSErr;
- {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
- INLINE $303C, $0001, $AA7A;
- {$ENDC}
- FUNCTION KBGetPS2KeyboardID(VAR deviceID: INTEGER): OSErr;
- {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
- INLINE $303C, $0002, $AA7A;
- {$ENDC}
- FUNCTION KBIsPS2KeyboardConnected: BOOLEAN;
- {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
- INLINE $303C, $0003, $AA7A;
- {$ENDC}
- FUNCTION KBIsPS2KeyboardEnabled: BOOLEAN;
- {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
- INLINE $303C, $0004, $AA7A;
- {$ENDC}
- FUNCTION KBGetPS2KeyboardAttributes: LONGINT;
- {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
- INLINE $303C, $0005, $AA7A;
- {$ENDC}
- FUNCTION KBSetKCAPForPS2Keyboard(kcapHandle: Handle): OSErr;
- {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
- INLINE $303C, $0006, $AA7A;
- {$ENDC}
- FUNCTION KBGetLayoutType(deviceID: INTEGER): LONGINT;
- {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
- INLINE $303C, $0007, $AA7A;
- {$ENDC}
- FUNCTION KBSetupPS2KeyboardFromLayoutType(layoutType: OSType): OSErr;
- {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
- INLINE $303C, $0008, $AA7A;
- {$ENDC}
- FUNCTION KBGetPS2KeyboardLayoutType(VAR layoutType: OSType): OSErr;
- {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
- INLINE $303C, $0009, $AA7A;
- {$ENDC}
-
- {$ALIGN RESET}
- {$POP}
-
- {$SETC UsingIncludes := KeyboardsIncludes}
-
- {$ENDC} {__KEYBOARDS__}
-
- {$IFC NOT UsingIncludes}
- END.
- {$ENDC}
-