FS2_Open
Open source remastering of the Freespace 2 engine
controlsconfig.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) Volition, Inc. 1999. All rights reserved.
3  *
4  * All source code herein is the property of Volition, Inc. You may not sell
5  * or otherwise commercially exploit the source or things you created based on the
6  * source.
7  *
8 */
9 
10 
11 #ifndef CONTROLS_CONFIG_H
12 #define CONTROLS_CONFIG_H
13 
14 #include "globalincs/pstypes.h"
15 
16 #define CONTROL_CONFIG_XSTR 507
17 
29 };
30 
31 
41 
46 };
47 
48 
49 
53 enum CC_type {
56 };
57 
61 typedef struct config_item {
62  short key_default;
63  short joy_default;
64  char tab;
65  bool hasXSTR;
66  char *text;
67  char type;
68  short key_id;
69  short joy_id;
70  int used;
71  bool disabled;
73 } config_item;
74 
80 enum IoActionId {
92 
100 
106 
117 
123  BANK_LEFT =26,
127  YAW_LEFT =30,
128  YAW_RIGHT =31,
129 
139 
156 
163  VIEW_SLEW =54,
172 
182 
200 
205  BANK_WHEN_PRESSED =84,
210 
216 
219 
222 
230 
235 
238 
240 
242 
244 
248  TOGGLE_HUD =107,
256 
261  NAV_CYCLE =116,
262 
267 
272 
277 };
278 
279 extern int Failed_key_index;
280 extern int Invert_heading;
281 extern int Invert_pitch;
282 extern int Invert_roll;
283 extern int Invert_thrust;
284 extern int Disable_axis2;
285 extern int Disable_axis3;
286 
287 extern int Axis_map_to[];
288 extern int Invert_axis[];
289 extern int Invert_axis_defaults[];
290 
291 extern int Control_config_overlay_id;
292 
293 extern config_item Control_config[];
294 extern SCP_vector<config_item*> Control_config_presets; // tabled control presets; pointers to config_item arrays
295 extern SCP_vector<SCP_string> Control_config_preset_names; // names for Control_config_presets (identical order of items)
296 extern char **Scan_code_text;
297 extern char **Joy_button_text;
298 
301 
302 void control_config_init();
303 void control_config_do_frame(float frametime);
304 void control_config_close();
305 
307 
308 void control_config_reset_defaults(int presetnum=-1);
309 int translate_key_to_index(const char *key, bool find_override=true);
310 char *translate_key(char *key);
311 char *textify_scancode(int code);
312 float check_control_timef(int id);
313 int check_control(int id, int key = -1);
314 void control_get_axes_readings(int *h, int *p, int *b, int *ta, int *tr);
315 void control_used(int id);
316 void control_config_clear();
317 void clear_key_binding(short key);
320 
321 #endif
int Invert_roll
target your target's target
PITCH_FORWARD.
Joy_axis_action_index
TOGGLE_GLIDING.
toggle the squadmate messaging menu
increase energy to engines
TARGET_NEXT_ESCORT_SHIP.
CC_type
GLfloat GLfloat GLfloat GLfloat h
Definition: Glext.h:7280
message all friendlies
VIEW_CENTER.
short key_id
actual key bound to action
void control_check_indicate()
TARGET_LAST_TRANMISSION_SENDER.
VIEW_EXTERNAL_TOGGLE_CAMERA_LOCK.
char ** Joy_button_text
decrease shield recharge rate
ZERO_THROTTLE.
int Axis_map_to[]
int check_control(int id, int key=-1)
VIEW_DIST_DECREASE.
void control_config_clear_used_status()
struct config_item config_item
RIGHT_SLIDE_THRUST.
wingman message: attack current target
IGNORE_MESSAGE.
cycle num primaries to fire at once
int Invert_axis_defaults[]
target the closest ship attacking current target
YAW_RIGHT.
REARM_MESSAGE.
char * translate_key(char *key)
toggle auto-match target speed
int Invert_heading
void control_config_clear()
YAW_LEFT.
BANK_RIGHT.
VIEW_TOPDOWN.
PADLOCK_UP.
void control_config_common_init()
initialize common control config stuff - call at game startup after localization has been initialized...
VIEW_OTHER_SHIP.
void control_config_common_close()
close common control config stuff - call at game shutdown
toggle network info
int key
target next
target closest ship that is attacking player
int Disable_axis2
bool disabled
whether this action should be available at all
char * textify_scancode(int code)
SHOW_NAVMAP.
VIEW_EXTERNAL.
int translate_key_to_index(const char *key, bool find_override=true)
short joy_id
joystick button bound to action
config_item Control_config[]
Stores the keyboard configuration.
target previous
match target speed
transfer shield energy to right
HWND DWORD code
Definition: vddraw.h:425
DOWN_SLIDE_THRUST.
stop targeting subsystems on ship
short joy_default
default joystick button bound to action
message all hostiles
float check_control_timef(int id)
A normal, one-shot type control that is activated when a key is or button is pressed.
REVERSE_THRUST.
void control_used(int id)
message targeted ship (if player)
wingman message: cover me
int Invert_pitch
bool continuous_ongoing
whether this action is a continuous one and is currently ongoing
void control_config_do_frame(float frametime)
toggle between high and low HUD contrast
increase shield recharge rate
VIEW_DIST_INCREASE.
decrease energy to engines
equalize recharge rates
wingman message: disarm current target
TARGET_PREV_LIVE_TURRET.
char tab
what tab (category) it belongs in
AFTERBURNER.
TARGET_PREV_SUBOBJECT.
wingman message: form on my wing
stop targeting ship
target next subsystem on current target
cycle number of missiles fired from secondary bank
VIEW_SLEW.
PADLOCK_RIGHT.
ADD_REMOVE_ESCORT.
ONE_THIRD_THROTTLE.
cycle to previous primary weapon
target ship closest to center of reticle
target the closest friendly ship
TIME_SLOW_DOWN.
transfer energy to shield from weapons
PITCH_BACK.
cycle to next secondary weapon
bool hasXSTR
whether we should translate this with an XSTR
PADLOCK_LEFT.
void control_config_reset_defaults(int presetnum=-1)
target the closest repair ship
int Invert_thrust
char type
manner control should be checked in
int used
has control been used yet in mission? If so, this is the timestamp
TARGET_NEXT_LIVE_TURRET.
wingman message: engage enemy
if i'm an observer, zoom to my targeted object
FIRE_SECONDARY.
FORWARD_THRUST.
transfer energy to weapons from shield
LEFT_SLIDE_THRUST.
int Invert_axis[]
UP_SLIDE_THRUST.
GLboolean GLboolean GLboolean b
Definition: Glext.h:5781
IoActionId
short key_default
default key bound to action
wingman message: protect current target
equalize shield energy to all quadrants
void control_config_cancel_exit()
void control_config_close()
TOGGLE_HUD.
TARGET_NEWEST_SHIP.
NAV_CYCLE.
HUD_TARGETBOX_TOGGLE_WIREFRAME.
int Failed_key_index
TARGET_PREV_BOMB.
Joy_axis_index
target ships subsystem in reticle
ESCORT_CLEAR.
end the mission
PADLOCK_DOWN.
TARGET_NEXT_BOMB.
A continous control that is activated as long as the key or button is held down.
Autopilot key control.
TWO_THIRDS_THROTTLE.
void control_get_axes_readings(int *h, int *p, int *b, int *ta, int *tr)
int Disable_axis3
FIRE_PRIMARY.
TIME_SPEED_UP.
cycle to next primary weapon
char * text
describes the action in the config screen
GLfloat GLfloat p
Definition: Glext.h:8373
decrease weapon recharge rate
The total number of defined control actions (or last define + 1)
toggle auto-targeting
message all netplayers
MINUS_5_PERCENT_THROTTLE.
show the mission goals screen
transfer shield energy to left
target the next friendly ship
wingman message: capture current target
VIEW_CHASE.
target the previous closest hostile
TARGET_PREV_UNINSPECTED_CARGO.
wingman message: disable current target
LAUNCH_COUNTERMEASURE.
BANK_LEFT.
SCP_vector< config_item * > Control_config_presets
BANK_WHEN_PRESSED.
self destruct (multiplayer only)
wingman message: warp out
cycle to next radar range
VIEW_TRACK_TARGET.
void clear_key_binding(short key)
int Control_config_overlay_id
MAX_THROTTLE.
wingman message: disable current target
SCP_vector< SCP_string > Control_config_preset_names
increase weapon recharge rate
TARGET_NEXT_UNINSPECTED_CARGO.
The total number of actions an axis may map to.
transfer shield energy to rear
target the next hostile target
transfer shield energy to front
char ** Scan_code_text
PLUS_5_PERCENT_THROTTLE.
void control_config_init()