]> icculus.org git repositories - divverent/darkplaces.git/blob - keys.h
Forgot to apply Vic's axial patch for r_light.c, here it is.
[divverent/darkplaces.git] / keys.h
1 /*
2 Copyright (C) 1996-1997 Id Software, Inc.
3
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
12
13 See the 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, USA.
18
19 */
20
21 #ifndef KEYS_H
22 #define KEYS_H
23
24 // these are the key numbers that should be passed to Key_Event
25
26 typedef enum {
27         K_TAB = 9,
28         K_ENTER = 13,
29         K_ESCAPE = 27,
30         K_SPACE = 32,
31
32         // normal keys should be passed as lowercased ascii
33
34         K_BACKSPACE = 127,
35
36         K_CAPSLOCK,
37         K_PRNTSCR,
38         K_SCRLCK,
39         K_PAUSE,
40
41         K_UPARROW,
42         K_DOWNARROW,
43         K_LEFTARROW,
44         K_RIGHTARROW,
45
46         K_ALT,
47         K_CTRL,
48         K_SHIFT,
49         K_F1,
50         K_F2,
51         K_F3,
52         K_F4,
53         K_F5,
54         K_F6,
55         K_F7,
56         K_F8,
57         K_F9,
58         K_F10,
59         K_F11,
60         K_F12,
61         K_INS,
62         K_DEL,
63         K_PGDN,
64         K_PGUP,
65         K_HOME,
66         K_END,
67
68
69         // Keypad stuff..
70
71         KP_NUMLCK,
72         KP_DIVIDE,
73         KP_MULTIPLY,
74
75         KP_HOME,
76         KP_UPARROW,
77         KP_PGUP,
78         KP_MINUS,
79
80         KP_LEFTARROW,
81         KP_5,
82         KP_RIGHTARROW,
83         KP_PLUS,
84
85         KP_END,
86         KP_DOWNARROW,
87         KP_PGDN,
88
89
90         KP_INS,
91         KP_DEL,
92         KP_ENTER,
93
94         // mouse buttons generate virtual keys
95         K_MOUSE1 = 200,
96         K_MOUSE2,
97         K_MOUSE3,
98
99         // joystick buttons
100         K_JOY1,
101         K_JOY2,
102         K_JOY3,
103         K_JOY4,
104
105         //
106         //// aux keys are for multi-buttoned joysticks to generate so they can use
107         //// the normal binding process
108         ////
109         //
110         K_AUX1,
111         K_AUX2,
112         K_AUX3,
113         K_AUX4,
114         K_AUX5,
115         K_AUX6,
116         K_AUX7,
117         K_AUX8,
118         K_AUX9,
119         K_AUX10,
120         K_AUX11,
121         K_AUX12,
122         K_AUX13,
123         K_AUX14,
124         K_AUX15,
125         K_AUX16,
126         K_AUX17,
127         K_AUX18,
128         K_AUX19,
129         K_AUX20,
130         K_AUX21,
131         K_AUX22,
132         K_AUX23,
133         K_AUX24,
134         K_AUX25,
135         K_AUX26,
136         K_AUX27,
137         K_AUX28,
138         K_AUX29,
139         K_AUX30,
140         K_AUX31,
141         K_AUX32,
142
143         // JACK: Intellimouse(c) Mouse Wheel Support
144
145         K_MWHEELUP,
146         K_MWHEELDOWN
147 } keynum_t;
148
149
150 typedef enum {key_game, key_console, key_message, key_menu} keydest_t;
151
152 extern keydest_t        key_dest;
153 extern char *keybindings[256];
154 extern  int             key_repeats[256];
155 extern  int             key_count;                      // incremented every key event
156 extern  int             key_lastpress;
157
158 void Key_Event (int key, qboolean down);
159 void Key_Init (void);
160 void Key_WriteBindings (QFile *f);
161 void Key_SetBinding (int keynum, char *binding);
162 void Key_ClearStates (void);
163
164 #endif
165