7 #include "MacCompatibility.h"
9 /**> CONSTANT DECLARATIONS <**/
11 #define MAC_1_KEY 0x12
12 #define MAC_2_KEY 0x13
13 #define MAC_3_KEY 0x14
14 #define MAC_4_KEY 0x15
15 #define MAC_5_KEY 0x17
16 #define MAC_6_KEY 0x16
17 #define MAC_7_KEY 0x1A
18 #define MAC_8_KEY 0x1C
19 #define MAC_9_KEY 0x19
20 #define MAC_0_KEY 0x1D
21 #define MAC_NUMPAD_1_KEY 0x53
22 #define MAC_NUMPAD_2_KEY 0x54
23 #define MAC_NUMPAD_3_KEY 0x55
24 #define MAC_NUMPAD_4_KEY 0x56
25 #define MAC_NUMPAD_5_KEY 0x57
26 #define MAC_NUMPAD_6_KEY 0x58
27 #define MAC_NUMPAD_7_KEY 0x59
28 #define MAC_NUMPAD_8_KEY 0x5B
29 #define MAC_NUMPAD_9_KEY 0x5C
30 #define MAC_NUMPAD_0_KEY 0x52
31 #define MAC_A_KEY 0x00
32 #define MAC_B_KEY 0x0B
33 #define MAC_C_KEY 0x08
34 #define MAC_D_KEY 0x02
35 #define MAC_E_KEY 0x0E
36 #define MAC_F_KEY 0x03
37 #define MAC_G_KEY 0x05
38 #define MAC_H_KEY 0x04
39 #define MAC_I_KEY 0x22
40 #define MAC_J_KEY 0x26
41 #define MAC_K_KEY 0x28
42 #define MAC_L_KEY 0x25
43 #define MAC_M_KEY 0x2E
44 #define MAC_N_KEY 0x2D
45 #define MAC_O_KEY 0x1F
46 #define MAC_P_KEY 0x23
47 #define MAC_Q_KEY 0x0C
48 #define MAC_R_KEY 0x0F
49 #define MAC_S_KEY 0x01
50 #define MAC_T_KEY 0x11
51 #define MAC_U_KEY 0x20
52 #define MAC_V_KEY 0x09
53 #define MAC_W_KEY 0x0D
54 #define MAC_X_KEY 0x07
55 #define MAC_Y_KEY 0x10
56 #define MAC_Z_KEY 0x06
57 #define MAC_F1_KEY 0x7A
58 #define MAC_F2_KEY 0x78
59 #define MAC_F3_KEY 0x63
60 #define MAC_F4_KEY 0x76
61 #define MAC_F5_KEY 0x60
62 #define MAC_F6_KEY 0x61
63 #define MAC_F7_KEY 0x62
64 #define MAC_F8_KEY 0x64
65 #define MAC_F9_KEY 0x65
66 #define MAC_F10_KEY 0x6D
67 #define MAC_F11_KEY 0x67
68 #define MAC_F12_KEY 0x6F
69 #define MAC_RETURN_KEY 0x24
70 #define MAC_ENTER_KEY 0x4C
71 #define MAC_TAB_KEY 0x30
72 #define MAC_SPACE_KEY 0x31
73 #define MAC_DELETE_KEY 0x33
74 #define MAC_ESCAPE_KEY 0x35
75 #define MAC_COMMAND_KEY 0x37
76 #define MAC_SHIFT_KEY 0x38
77 #define MAC_CAPS_LOCK_KEY 0x39
78 #define MAC_OPTION_KEY 0x3A
79 #define MAC_CONTROL_KEY 0x3B
80 #define MAC_PAGE_UP_KEY 0x74
81 #define MAC_PAGE_DOWN_KEY 0x79
82 #define MAC_INSERT_KEY 0x72
83 #define MAC_DEL_KEY 0x75
84 #define MAC_HOME_KEY 0x73
85 #define MAC_END_KEY 0x77
86 #define MAC_LEFT_BRACKET_KEY 0x21
87 #define MAC_RIGHT_BRACKET_KEY 0x1E
88 #define MAC_ARROW_UP_KEY 0x7E
89 #define MAC_ARROW_DOWN_KEY 0x7D
90 #define MAC_ARROW_LEFT_KEY 0x7B
91 #define MAC_ARROW_RIGHT_KEY 0x7C
92 #define MAC_TILDE_KEY 0x32
93 #define MAC_MINUS_KEY 0x1B
94 #define MAC_PLUS_KEY 0x18
95 #define MAC_SLASH_KEY 0x2C
96 #define MAC_PERIOD_KEY 0x2F
97 #define MAC_COMMA_KEY 0x2B
98 #define MAC_BACKSLASH_KEY 0x2A
99 #define MAC_LEFTBRACKET_KEY 0x21
100 #define MAC_RIGHTBRACKET_KEY 0x1E
101 #define MAC_NUMPAD_CLEAR_KEY 0x47
102 #define MAC_NUMPAD_MINUS_KEY 0x4E
103 #define MAC_NUMPAD_EQUALS_KEY 0x51
104 #define MAC_NUMPAD_PLUS_KEY 0x45
105 #define MAC_NUMPAD_SLASH_KEY 0x4B
106 #define MAC_NUMPAD_ASTERISK_KEY 0x43
107 #define MAC_NUMPAD_ENTER_KEY 0x4C
108 #define MAC_NUMPAD_PERIOD_KEY 0x41
109 #define MAC_SEMICOLON_KEY 0x29
110 #define MAC_APOSTROPHE_KEY 0x27
111 #define MAC_MOUSEBUTTON1 10000
112 #define MAC_MOUSEBUTTON2 10001
114 #define UNKNOWN_KEY 0xFF
117 /**> FUNCTION PROTOTYPES <**/
118 Boolean IsKeyDown( unsigned char *keyMap, unsigned short theKey );
120 void MoveMouse(int xcoord, int ycoord, Point *mouseloc);
121 void RefreshMouse(Point *mouseloc);
123 unsigned short CharToKey(char* which);
124 char* KeyToChar(unsigned short which);
125 char KeyToSingleChar(unsigned short which);
126 char Shift(char which);
127 bool Compare(char *thestring, char *tocompare, int start, int end);
130 typedef unsigned char KeyMap[16];
131 void GetKeys( unsigned char theKeys[16]);