3 // ID_IN.h - Header file for Input Manager
\r
5 // By Jason Blochowiak
\r
12 #define __DEBUG_InputMgr__
\r
15 #define MaxPlayers 4
\r
18 #define NumCodes 128
\r
20 typedef byte ScanCode;
\r
23 #define sc_Return 0x1c
\r
24 #define sc_Enter sc_Return
\r
25 #define sc_Escape 0x01
\r
26 #define sc_Space 0x39
\r
27 #define sc_BackSpace 0x0e
\r
30 #define sc_Control 0x1d
\r
31 #define sc_CapsLock 0x3a
\r
32 #define sc_LShift 0x2a
\r
33 #define sc_RShift 0x36
\r
34 #define sc_UpArrow 0x48
\r
35 #define sc_DownArrow 0x50
\r
36 #define sc_LeftArrow 0x4b
\r
37 #define sc_RightArrow 0x4d
\r
38 #define sc_Insert 0x52
\r
39 #define sc_Delete 0x53
\r
40 #define sc_Home 0x47
\r
42 #define sc_PgUp 0x49
\r
43 #define sc_PgDn 0x51
\r
96 #define key_Return 0x0d
\r
97 #define key_Enter key_Return
\r
98 #define key_Escape 0x1b
\r
99 #define key_Space 0x20
\r
100 #define key_BackSpace 0x08
\r
101 #define key_Tab 0x09
\r
102 #define key_Delete 0x7f
\r
104 // Stuff for the mouse
\r
109 #define MouseInt 0x33
\r
110 #define Mouse(x) _AX = x,geninterrupt(MouseInt)
\r
113 demo_Off,demo_Record,demo_Playback,demo_PlayDone
\r
117 ctrl_Keyboard1 = ctrl_Keyboard,ctrl_Keyboard2,
\r
119 ctrl_Joystick1 = ctrl_Joystick,ctrl_Joystick2,
\r
123 motion_Left = -1,motion_Up = -1,
\r
125 motion_Right = 1,motion_Down = 1
\r
128 dir_North,dir_NorthEast,
\r
129 dir_East,dir_SouthEast,
\r
130 dir_South,dir_SouthWest,
\r
131 dir_West,dir_NorthWest,
\r
135 boolean button0,button1,button2,button3;
\r
137 Motion xaxis,yaxis;
\r
140 typedef CursorInfo ControlInfo;
\r
142 ScanCode button0,button1,
\r
143 upleft, up, upright,
\r
145 downleft, down, downright;
\r
148 word joyMinX,joyMinY,
\r
149 threshMinX,threshMinY,
\r
150 threshMaxX,threshMaxY,
\r
152 joyMultXL,joyMultYL,
\r
153 joyMultXH,joyMultYH;
\r
155 // Global variables
\r
156 extern boolean Keyboard[],
\r
159 extern boolean Paused;
\r
160 extern char LastASCII;
\r
161 extern ScanCode LastScan;
\r
162 extern KeyboardDef KbdDefs;
\r
163 extern JoystickDef JoyDefs[];
\r
164 extern ControlType Controls[MaxPlayers];
\r
166 extern Demo DemoMode;
\r
167 extern byte _seg *DemoBuffer;
\r
168 extern word DemoOffset,DemoSize;
\r
170 // Function prototypes
\r
171 #define IN_KeyDown(code) (Keyboard[(code)])
\r
172 #define IN_ClearKey(code) {Keyboard[code] = false;\
\r
173 if (code == LastScan) LastScan = sc_None;}
\r
175 // DEBUG - put names in prototypes
\r
176 extern void IN_Startup(void),IN_Shutdown(void),
\r
177 IN_Default(boolean gotit,ControlType in),
\r
178 IN_SetKeyHook(void (*)()),
\r
179 IN_ClearKeysDown(void),
\r
180 IN_ReadCursor(CursorInfo *),
\r
181 IN_ReadControl(int,ControlInfo *),
\r
182 IN_SetControlType(int,ControlType),
\r
183 IN_GetJoyAbs(word joy,word *xp,word *yp),
\r
184 IN_SetupJoy(word joy,word minx,word maxx,
\r
185 word miny,word maxy),
\r
186 IN_StopDemo(void),IN_FreeDemoBuffer(void),
\r
187 IN_Ack(void),IN_AckBack(void);
\r
188 extern boolean IN_UserInput(longword delay);
\r
189 extern char IN_WaitForASCII(void);
\r
190 extern ScanCode IN_WaitForKey(void);
\r
191 extern word IN_GetJoyButtonsDB(word joy);
\r
192 extern byte *IN_GetScanName(ScanCode);
\r
195 byte IN_MouseButtons (void);
\r
196 byte IN_JoyButtons (void);
\r
198 void INL_GetJoyDelta(word joy,int *dx,int *dy);
\r
199 void IN_StartAck(void);
\r
200 boolean IN_CheckAck (void);
\r