1 /*
2  * MacInput.h
3  * Copyright (C) 2007 by Bryan Duff <duff0097@gmail.com>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
18  * USA
19  */
20 #ifndef _MACINPUT_H_
21 #define _MACINPUT_H_
22 
23 /**> HEADER FILES <**/
24 #include <stdlib.h>
25 #include <stdio.h>
26 
27 /**> CONSTANT DECLARATIONS <**/
28 // Mac Keyboard Codes
29 #define	MAC_1_KEY				0x12
30 #define	MAC_2_KEY				0x13
31 #define	MAC_3_KEY				0x14
32 #define	MAC_4_KEY				0x15
33 #define	MAC_5_KEY				0x17
34 #define	MAC_6_KEY				0x16
35 #define	MAC_7_KEY				0x1A
36 #define	MAC_8_KEY				0x1C
37 #define	MAC_9_KEY				0x19
38 #define	MAC_0_KEY				0x1D
39 #define	MAC_NUMPAD_1_KEY		0x53
40 #define	MAC_NUMPAD_2_KEY		0x54
41 #define	MAC_NUMPAD_3_KEY		0x55
42 #define	MAC_NUMPAD_4_KEY		0x56
43 #define	MAC_NUMPAD_5_KEY		0x57
44 #define	MAC_NUMPAD_6_KEY		0x58
45 #define	MAC_NUMPAD_7_KEY		0x59
46 #define	MAC_NUMPAD_8_KEY		0x5B
47 #define	MAC_NUMPAD_9_KEY		0x5C
48 #define	MAC_NUMPAD_0_KEY		0x52
49 #define	MAC_A_KEY				0x00
50 #define	MAC_B_KEY				0x0B
51 #define	MAC_C_KEY				0x08
52 #define	MAC_D_KEY				0x02
53 #define	MAC_E_KEY				0x0E
54 #define	MAC_F_KEY				0x03
55 #define	MAC_G_KEY				0x05
56 #define	MAC_H_KEY				0x04
57 #define	MAC_I_KEY				0x22
58 #define	MAC_J_KEY				0x26
59 #define	MAC_K_KEY				0x28
60 #define	MAC_L_KEY				0x25
61 #define	MAC_M_KEY				0x2E
62 #define	MAC_N_KEY				0x2D
63 #define	MAC_O_KEY				0x1F
64 #define	MAC_P_KEY				0x23
65 #define	MAC_Q_KEY				0x0C
66 #define	MAC_R_KEY				0x0F
67 #define	MAC_S_KEY				0x01
68 #define	MAC_T_KEY				0x11
69 #define	MAC_U_KEY				0x20
70 #define	MAC_V_KEY				0x09
71 #define	MAC_W_KEY				0x0D
72 #define	MAC_X_KEY				0x07
73 #define	MAC_Y_KEY				0x10
74 #define	MAC_Z_KEY				0x06
75 #define	MAC_F1_KEY				0x7A
76 #define	MAC_F2_KEY				0x78
77 #define	MAC_F3_KEY				0x63
78 #define	MAC_F4_KEY				0x76
79 #define	MAC_F5_KEY				0x60
80 #define	MAC_F6_KEY				0x61
81 #define	MAC_F7_KEY				0x62
82 #define	MAC_F8_KEY				0x64
83 #define	MAC_F9_KEY				0x65
84 #define	MAC_F10_KEY				0x6D
85 #define	MAC_F11_KEY				0x67
86 #define	MAC_F12_KEY				0x6F
87 #define	MAC_RETURN_KEY			0x24
88 #define	MAC_ENTER_KEY			0x4C
89 #define	MAC_TAB_KEY				0x30
90 #define	MAC_SPACE_KEY			0x31
91 #define	MAC_DELETE_KEY			0x33
92 #define	MAC_ESCAPE_KEY			0x35
93 #define	MAC_COMMAND_KEY			0x37
94 #define	MAC_SHIFT_KEY			0x38
95 #define	MAC_CAPS_LOCK_KEY		0x39
96 #define	MAC_OPTION_KEY			0x3A
97 #define	MAC_CONTROL_KEY			0x3B
98 #define	MAC_PAGE_UP_KEY			0x74
99 #define	MAC_PAGE_DOWN_KEY		0x79
100 #define	MAC_INSERT_KEY			0x72
101 #define	MAC_DEL_KEY				0x75
102 #define	MAC_HOME_KEY			0x73
103 #define	MAC_END_KEY				0x77
104 #define	MAC_LEFT_BRACKET_KEY	0x21
105 #define	MAC_RIGHT_BRACKET_KEY	0x1E
106 #define	MAC_ARROW_UP_KEY		0x7E
107 #define	MAC_ARROW_DOWN_KEY		0x7D
108 #define	MAC_ARROW_LEFT_KEY		0x7B
109 #define	MAC_ARROW_RIGHT_KEY		0x7C
110 
111 Boolean IsKeyDown(unsigned char *keyMap, unsigned short theKey);
112 void InitMouse();
113 void MoveMouse(int xcoord, int ycoord, Point * mouseloc);
114 void RefreshMouse(Point * mouseloc);
115 void DisposeMouse();
116 
117 #endif
118