Starshatter_Open
Open source Starshatter engine
Main Page
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
KeyMap.h
Go to the documentation of this file.
1
/* Project Starshatter 4.6
2
Destroyer Studios LLC
3
Copyright © 1997-2006. All Rights Reserved.
4
5
SUBSYSTEM: Stars.exe
6
FILE: KeyMap.h
7
AUTHOR: John DiCamillo
8
9
10
OVERVIEW
11
========
12
Keyboard Mapping
13
*/
14
15
#ifndef KeyMap_h
16
#define KeyMap_h
17
18
#include "
Types.h
"
19
#include "
Geometry.h
"
20
#include "
MotionController.h
"
21
22
// +--------------------------------------------------------------------+
23
24
class
KeyMap
25
{
26
public
:
27
KeyMap
();
28
virtual
~KeyMap
();
29
30
int
DefaultKeyMap
(
int
max_keys = 256);
31
int
LoadKeyMap
(
const
char
* filename,
int
max_keys = 256);
32
int
SaveKeyMap
(
const
char
* filename,
int
max_keys = 256);
33
34
enum
KEY_CATEGORY
{
KEY_FLIGHT
,
KEY_WEAPONS
,
KEY_VIEW
,
KEY_MISC
};
35
36
int
GetCategory
(
int
i);
37
const
char
*
DescribeAction
(
int
i);
38
const
char
*
DescribeKey
(
int
i);
39
int
FindMapIndex
(
int
act);
40
41
static
const
char
*
DescribeKey
(
int
vk,
int
shift,
int
joy);
42
static
int
GetMappableVKey
(
int
n);
43
44
int
GetNumKeys
() {
return
nkeys
; }
45
KeyMapEntry
*
GetMapping
() {
return
map
; }
46
KeyMapEntry
*
GetKeyMap
(
int
i) {
return
&
map
[i]; }
47
KeyMapEntry
*
GetDefault
(
int
i) {
return
&
defmap
[i]; }
48
49
void
Bind
(
int
a,
int
k,
int
s);
50
51
static
int
GetKeyAction
(
const
char
* act_str);
52
static
int
GetKeyActionIndex
(
int
act);
53
static
int
GetKeyKey
(
const
char
* key_str);
54
static
int
GetKeyKeyIndex
(
int
key);
55
56
protected
:
57
int
BuildDefaultKeyMap
();
58
59
KeyMapEntry
map
[256];
60
KeyMapEntry
defmap
[256];
61
int
nkeys
;
62
};
63
64
// +--------------------------------------------------------------------+
65
66
67
const
int
KEY_EXIT
= 0 +
KEY_USER_BASE
;
68
const
int
KEY_PAUSE
= 1 +
KEY_USER_BASE
;
69
const
int
KEY_NEXT_VIEW
= 2 +
KEY_USER_BASE
;
70
const
int
KEY_TARGET_PADLOCK
= 3 +
KEY_USER_BASE
;
71
const
int
KEY_THREAT_PADLOCK
= 4 +
KEY_USER_BASE
;
72
const
int
KEY_LOCK_TARGET
= 5 +
KEY_USER_BASE
;
73
const
int
KEY_LOCK_THREAT
= 6 +
KEY_USER_BASE
;
74
const
int
KEY_AUTO_NAV
= 7 +
KEY_USER_BASE
;
75
const
int
KEY_TIME_COMPRESS
= 8 +
KEY_USER_BASE
;
76
const
int
KEY_TIME_EXPAND
= 9 +
KEY_USER_BASE
;
77
const
int
KEY_TIME_SKIP
= 10 +
KEY_USER_BASE
;
78
79
const
int
KEY_SWAP_ROLL_YAW
= 11 +
KEY_USER_BASE
;
80
81
const
int
KEY_THROTTLE_UP
= 15 +
KEY_USER_BASE
;
82
const
int
KEY_THROTTLE_DOWN
= 16 +
KEY_USER_BASE
;
83
const
int
KEY_THROTTLE_ZERO
= 17 +
KEY_USER_BASE
;
84
const
int
KEY_THROTTLE_FULL
= 18 +
KEY_USER_BASE
;
85
const
int
KEY_CYCLE_PRIMARY
= 19 +
KEY_USER_BASE
;
86
const
int
KEY_CYCLE_SECONDARY
= 20 +
KEY_USER_BASE
;
87
const
int
KEY_FLCS_MODE_AUTO
= 21 +
KEY_USER_BASE
;
88
const
int
KEY_DROP_ORBIT
= 22 +
KEY_USER_BASE
;
89
90
const
int
KEY_HUD_INST
= 23 +
KEY_USER_BASE
;
91
const
int
KEY_CAM_BRIDGE
= 24 +
KEY_USER_BASE
;
92
const
int
KEY_CAM_CHASE
= 25 +
KEY_USER_BASE
;
93
const
int
KEY_CAM_EXTERN
= 26 +
KEY_USER_BASE
;
94
const
int
KEY_HUD_MODE
= 27 +
KEY_USER_BASE
;
95
const
int
KEY_HUD_COLOR
= 28 +
KEY_USER_BASE
;
96
const
int
KEY_HUD_WARN
= 29 +
KEY_USER_BASE
;
97
const
int
KEY_NAV_DLG
= 30 +
KEY_USER_BASE
;
98
const
int
KEY_WEP_DLG
= 31 +
KEY_USER_BASE
;
99
const
int
KEY_FLT_DLG
= 32 +
KEY_USER_BASE
;
100
const
int
KEY_ENG_DLG
= 33 +
KEY_USER_BASE
;
101
102
const
int
KEY_ZOOM_WIDE
= 34 +
KEY_USER_BASE
;
103
const
int
KEY_ZOOM_IN
= 35 +
KEY_USER_BASE
;
104
const
int
KEY_ZOOM_OUT
= 36 +
KEY_USER_BASE
;
105
const
int
KEY_CAM_CYCLE_OBJECT
= 37 +
KEY_USER_BASE
;
106
const
int
KEY_CAM_EXT_PLUS_AZ
= 38 +
KEY_USER_BASE
;
107
const
int
KEY_CAM_EXT_MINUS_AZ
= 39 +
KEY_USER_BASE
;
108
const
int
KEY_CAM_EXT_PLUS_EL
= 40 +
KEY_USER_BASE
;
109
const
int
KEY_CAM_EXT_MINUS_EL
= 41 +
KEY_USER_BASE
;
110
const
int
KEY_CAM_EXT_PLUS_RANGE
= 42 +
KEY_USER_BASE
;
111
const
int
KEY_CAM_EXT_MINUS_RANGE
= 43 +
KEY_USER_BASE
;
112
const
int
KEY_CAM_VIEW_SELECTION
= 44 +
KEY_USER_BASE
;
113
const
int
KEY_CAM_DROP
= 45 +
KEY_USER_BASE
;
114
115
const
int
KEY_TARGET_SELECTION
= 50 +
KEY_USER_BASE
;
116
const
int
KEY_RADIO_MENU
= 51 +
KEY_USER_BASE
;
117
const
int
KEY_QUANTUM_MENU
= 52 +
KEY_USER_BASE
;
118
const
int
KEY_MFD1
= 53 +
KEY_USER_BASE
;
119
const
int
KEY_MFD2
= 54 +
KEY_USER_BASE
;
120
const
int
KEY_MFD3
= 55 +
KEY_USER_BASE
;
121
const
int
KEY_MFD4
= 56 +
KEY_USER_BASE
;
122
123
const
int
KEY_SENSOR_MODE
= 60 +
KEY_USER_BASE
;
124
const
int
KEY_SENSOR_GROUND_MODE
= 61 +
KEY_USER_BASE
;
125
const
int
KEY_SENSOR_BEAM
= 62 +
KEY_USER_BASE
;
126
const
int
KEY_SENSOR_RANGE_PLUS
= 63 +
KEY_USER_BASE
;
127
const
int
KEY_SENSOR_RANGE_MINUS
= 64 +
KEY_USER_BASE
;
128
const
int
KEY_EMCON_PLUS
= 65 +
KEY_USER_BASE
;
129
const
int
KEY_EMCON_MINUS
= 66 +
KEY_USER_BASE
;
130
131
const
int
KEY_SHIELDS_UP
= 67 +
KEY_USER_BASE
;
132
const
int
KEY_SHIELDS_DOWN
= 68 +
KEY_USER_BASE
;
133
const
int
KEY_SHIELDS_FULL
= 69 +
KEY_USER_BASE
;
134
const
int
KEY_SHIELDS_ZERO
= 70 +
KEY_USER_BASE
;
135
const
int
KEY_DECOY
= 71 +
KEY_USER_BASE
;
136
const
int
KEY_ECM_TOGGLE
= 72 +
KEY_USER_BASE
;
137
const
int
KEY_LAUNCH_PROBE
= 73 +
KEY_USER_BASE
;
138
const
int
KEY_GEAR_TOGGLE
= 74 +
KEY_USER_BASE
;
139
140
const
int
KEY_LOCK_CLOSEST_SHIP
= 75 +
KEY_USER_BASE
;
141
const
int
KEY_LOCK_CLOSEST_THREAT
= 76 +
KEY_USER_BASE
;
142
const
int
KEY_LOCK_HOSTILE_SHIP
= 77 +
KEY_USER_BASE
;
143
const
int
KEY_LOCK_HOSTILE_THREAT
= 78 +
KEY_USER_BASE
;
144
const
int
KEY_CYCLE_SUBTARGET
= 79 +
KEY_USER_BASE
;
145
const
int
KEY_PREV_SUBTARGET
= 80 +
KEY_USER_BASE
;
146
147
const
int
KEY_AUGMENTER
= 81 +
KEY_USER_BASE
;
148
const
int
KEY_NAVLIGHT_TOGGLE
= 82 +
KEY_USER_BASE
;
149
150
const
int
KEY_CAM_VIRT
= 85 +
KEY_USER_BASE
;
151
const
int
KEY_CAM_VIRT_PLUS_AZ
= 86 +
KEY_USER_BASE
;
152
const
int
KEY_CAM_VIRT_MINUS_AZ
= 87 +
KEY_USER_BASE
;
153
const
int
KEY_CAM_VIRT_PLUS_EL
= 88 +
KEY_USER_BASE
;
154
const
int
KEY_CAM_VIRT_MINUS_EL
= 89 +
KEY_USER_BASE
;
155
156
const
int
KEY_COMM_ATTACK_TGT
= 90 +
KEY_USER_BASE
;
157
const
int
KEY_COMM_ESCORT_TGT
= 91 +
KEY_USER_BASE
;
158
const
int
KEY_COMM_WEP_FREE
= 92 +
KEY_USER_BASE
;
159
const
int
KEY_COMM_WEP_HOLD
= 93 +
KEY_USER_BASE
;
160
const
int
KEY_COMM_COVER_ME
= 94 +
KEY_USER_BASE
;
161
const
int
KEY_COMM_SKIP_NAV
= 95 +
KEY_USER_BASE
;
162
const
int
KEY_COMM_RETURN_TO_BASE
= 96 +
KEY_USER_BASE
;
163
const
int
KEY_COMM_CALL_INBOUND
= 97 +
KEY_USER_BASE
;
164
const
int
KEY_COMM_REQUEST_PICTURE
= 98 +
KEY_USER_BASE
;
165
const
int
KEY_COMM_REQUEST_SUPPORT
= 99 +
KEY_USER_BASE
;
166
167
const
int
KEY_CHAT_BROADCAST
= 100 +
KEY_USER_BASE
;
168
const
int
KEY_CHAT_TEAM
= 101 +
KEY_USER_BASE
;
169
const
int
KEY_CHAT_WING
= 102 +
KEY_USER_BASE
;
170
const
int
KEY_CHAT_UNIT
= 103 +
KEY_USER_BASE
;
171
172
const
int
KEY_COMMAND_MODE
= 104 +
KEY_USER_BASE
;
173
const
int
KEY_SELF_DESTRUCT
= 105 +
KEY_USER_BASE
;
174
175
/*** For Debug Convenience Only: ***/
176
const
int
KEY_INC_STARDATE
= 120 +
KEY_USER_BASE
;
177
const
int
KEY_DEC_STARDATE
= 121 +
KEY_USER_BASE
;
178
/***/
179
180
#endif KeyMap_h
181
Stars45
KeyMap.h
Generated on Tue Jun 5 2012 20:46:55 for Starshatter_Open by
1.8.1