]> icculus.org git repositories - divverent/darkplaces.git/blob - keys.h
moved viewmodel rendering to avoid polluting the main model rendering time
[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 // these are the key numbers that should be passed to Key_Event
22
23 typedef enum {
24         K_TAB = 9,
25         K_ENTER = 13,
26         K_ESCAPE = 27,
27         K_SPACE = 32,
28
29         // normal keys should be passed as lowercased ascii
30
31         K_BACKSPACE = 127,
32
33         K_CAPSLOCK,
34         K_PRNTSCR,
35         K_SCRLCK,
36         K_PAUSE,
37
38         K_UPARROW,
39         K_DOWNARROW,
40         K_LEFTARROW,
41         K_RIGHTARROW,
42
43         K_ALT,
44         K_CTRL,
45         K_SHIFT,
46         K_F1,
47         K_F2,
48         K_F3,
49         K_F4,
50         K_F5,
51         K_F6,
52         K_F7,
53         K_F8,
54         K_F9,
55         K_F10,
56         K_F11,
57         K_F12,
58         K_INS,
59         K_DEL,
60         K_PGDN,
61         K_PGUP,
62         K_HOME,
63         K_END,
64
65
66         // Keypad stuff..
67
68         KP_NUMLCK,
69         KP_DIVIDE,
70         KP_MULTIPLY,
71
72         KP_HOME,
73         KP_UPARROW,
74         KP_PGUP,
75         KP_MINUS,
76
77         KP_LEFTARROW,
78         KP_5,
79         KP_RIGHTARROW,
80         KP_PLUS,
81
82         KP_END,
83         KP_DOWNARROW,
84         KP_PGDN,
85
86
87         KP_INS,
88         KP_DEL,
89         KP_ENTER,
90
91         // mouse buttons generate virtual keys
92         K_MOUSE1 = 200,
93         K_MOUSE2,
94         K_MOUSE3,
95
96         // joystick buttons
97         K_JOY1,
98         K_JOY2,
99         K_JOY3,
100         K_JOY4,
101
102         //
103         //// aux keys are for multi-buttoned joysticks to generate so they can use
104         //// the normal binding process
105         ////
106         //
107         K_AUX1,
108         K_AUX2,
109         K_AUX3,
110         K_AUX4,
111         K_AUX5,
112         K_AUX6,
113         K_AUX7,
114         K_AUX8,
115         K_AUX9,
116         K_AUX10,
117         K_AUX11,
118         K_AUX12,
119         K_AUX13,
120         K_AUX14,
121         K_AUX15,
122         K_AUX16,
123         K_AUX17,
124         K_AUX18,
125         K_AUX19,
126         K_AUX20,
127         K_AUX21,
128         K_AUX22,
129         K_AUX23,
130         K_AUX24,
131         K_AUX25,
132         K_AUX26,
133         K_AUX27,
134         K_AUX28,
135         K_AUX29,
136         K_AUX30,
137         K_AUX31,
138         K_AUX32,
139
140         // JACK: Intellimouse(c) Mouse Wheel Support
141
142         K_MWHEELUP,
143         K_MWHEELDOWN
144 } keynum_t;
145
146
147 typedef enum {key_game, key_console, key_message, key_menu} keydest_t;
148
149 extern keydest_t        key_dest;
150 extern char *keybindings[256];
151 extern  int             key_repeats[256];
152 extern  int             key_count;                      // incremented every key event
153 extern  int             key_lastpress;
154
155 void Key_Event (int key, qboolean down);
156 void Key_Init (void);
157 void Key_WriteBindings (QFile *f);
158 void Key_SetBinding (int keynum, char *binding);
159 void Key_ClearStates (void);
160