FS2_Open
Open source remastering of the Freespace 2 engine
controlsconfig.h File Reference

Go to the source code of this file.

Classes

struct  config_item
 

Macros

#define CONTROL_CONFIG_XSTR   507
 

Typedefs

typedef struct config_item config_item
 

Enumerations

enum  Joy_axis_index {
  JOY_X_AXIS =0, JOY_Y_AXIS, JOY_Z_AXIS, JOY_RX_AXIS,
  JOY_RY_AXIS, JOY_RZ_AXIS
}
 
enum  Joy_axis_action_index {
  JOY_HEADING_AXIS =0, JOY_PITCH_AXIS, JOY_BANK_AXIS, JOY_ABS_THROTTLE_AXIS,
  JOY_REL_THROTTLE_AXIS, NUM_JOY_AXIS_ACTIONS
}
 
enum  CC_type { CC_TYPE_TRIGGER =0, CC_TYPE_CONTINUOUS }
 
enum  IoActionId {
  TARGET_NEXT =0, TARGET_PREV =1, TARGET_NEXT_CLOSEST_HOSTILE =2, TARGET_PREV_CLOSEST_HOSTILE =3,
  TOGGLE_AUTO_TARGETING =4, TARGET_NEXT_CLOSEST_FRIENDLY =5, TARGET_PREV_CLOSEST_FRIENDLY =6, TARGET_SHIP_IN_RETICLE =7,
  TARGET_CLOSEST_SHIP_ATTACKING_TARGET =8, TARGET_LAST_TRANMISSION_SENDER =9, STOP_TARGETING_SHIP =10, TARGET_SUBOBJECT_IN_RETICLE =11,
  TARGET_NEXT_SUBOBJECT =12, TARGET_PREV_SUBOBJECT =13, STOP_TARGETING_SUBSYSTEM =14, MATCH_TARGET_SPEED =15,
  TOGGLE_AUTO_MATCH_TARGET_SPEED =16, FIRE_PRIMARY =17, FIRE_SECONDARY =18, CYCLE_NEXT_PRIMARY =19,
  CYCLE_PREV_PRIMARY =20, CYCLE_SECONDARY =21, CYCLE_NUM_MISSLES =22, LAUNCH_COUNTERMEASURE =23,
  FORWARD_THRUST =24, REVERSE_THRUST =25, BANK_LEFT =26, BANK_RIGHT =27,
  PITCH_FORWARD =28, PITCH_BACK =29, YAW_LEFT =30, YAW_RIGHT =31,
  ZERO_THROTTLE =32, MAX_THROTTLE =33, ONE_THIRD_THROTTLE =34, TWO_THIRDS_THROTTLE =35,
  PLUS_5_PERCENT_THROTTLE =36, MINUS_5_PERCENT_THROTTLE =37, ATTACK_MESSAGE =38, DISARM_MESSAGE =39,
  DISABLE_MESSAGE =40, ATTACK_SUBSYSTEM_MESSAGE =41, CAPTURE_MESSAGE =42, ENGAGE_MESSAGE =43,
  FORM_MESSAGE =44, IGNORE_MESSAGE =45, PROTECT_MESSAGE =46, COVER_MESSAGE =47,
  WARP_MESSAGE =48, REARM_MESSAGE =49, TARGET_CLOSEST_SHIP_ATTACKING_SELF =50, VIEW_CHASE =51,
  VIEW_EXTERNAL =52, VIEW_EXTERNAL_TOGGLE_CAMERA_LOCK =53, VIEW_SLEW =54, VIEW_OTHER_SHIP =55,
  VIEW_DIST_INCREASE =56, VIEW_DIST_DECREASE =57, VIEW_CENTER =58, PADLOCK_UP =59,
  PADLOCK_DOWN =60, PADLOCK_LEFT =61, PADLOCK_RIGHT =62, RADAR_RANGE_CYCLE =63,
  SQUADMSG_MENU =64, SHOW_GOALS =65, END_MISSION =66, TARGET_TARGETS_TARGET =67,
  AFTERBURNER =68, INCREASE_WEAPON =69, DECREASE_WEAPON =70, INCREASE_SHIELD =71,
  DECREASE_SHIELD =72, INCREASE_ENGINE =73, DECREASE_ENGINE =74, ETS_EQUALIZE =75,
  SHIELD_EQUALIZE =76, SHIELD_XFER_TOP =77, SHIELD_XFER_BOTTOM =78, SHIELD_XFER_LEFT =79,
  SHIELD_XFER_RIGHT =80, XFER_SHIELD =81, XFER_LASER =82, GLIDE_WHEN_PRESSED =83,
  BANK_WHEN_PRESSED =84, SHOW_NAVMAP =85, ADD_REMOVE_ESCORT =86, ESCORT_CLEAR =87,
  TARGET_NEXT_ESCORT_SHIP =88, TARGET_CLOSEST_REPAIR_SHIP =89, TARGET_NEXT_UNINSPECTED_CARGO =90, TARGET_PREV_UNINSPECTED_CARGO =91,
  TARGET_NEWEST_SHIP =92, TARGET_NEXT_LIVE_TURRET =93, TARGET_PREV_LIVE_TURRET =94, TARGET_NEXT_BOMB =95,
  TARGET_PREV_BOMB =96, MULTI_MESSAGE_ALL =97, MULTI_MESSAGE_FRIENDLY =98, MULTI_MESSAGE_HOSTILE =99,
  MULTI_MESSAGE_TARGET =100, MULTI_OBSERVER_ZOOM_TO =101, TIME_SPEED_UP =102, TIME_SLOW_DOWN =103,
  TOGGLE_HUD_CONTRAST =104, MULTI_TOGGLE_NETINFO =105, MULTI_SELF_DESTRUCT =106, TOGGLE_HUD =107,
  RIGHT_SLIDE_THRUST =108, LEFT_SLIDE_THRUST =109, UP_SLIDE_THRUST =110, DOWN_SLIDE_THRUST =111,
  HUD_TARGETBOX_TOGGLE_WIREFRAME =112, VIEW_TOPDOWN =113, VIEW_TRACK_TARGET =114, AUTO_PILOT_TOGGLE =115,
  NAV_CYCLE =116, TOGGLE_GLIDING =117, CYCLE_PRIMARY_WEAPON_SEQUENCE =118, CCFG_MAX
}
 

Functions

void control_config_common_init ()
 initialize common control config stuff - call at game startup after localization has been initialized More...
 
void control_config_common_close ()
 close common control config stuff - call at game shutdown More...
 
void control_config_init ()
 
void control_config_do_frame (float frametime)
 
void control_config_close ()
 
void control_config_cancel_exit ()
 
void control_config_reset_defaults (int presetnum=-1)
 
int translate_key_to_index (const char *key, bool find_override=true)
 
char * translate_key (char *key)
 
char * textify_scancode (int code)
 
float check_control_timef (int id)
 
int check_control (int id, int key=-1)
 
void control_get_axes_readings (int *h, int *p, int *b, int *ta, int *tr)
 
void control_used (int id)
 
void control_config_clear ()
 
void clear_key_binding (short key)
 
void control_check_indicate ()
 
void control_config_clear_used_status ()
 

Variables

int Failed_key_index
 
int Invert_heading
 
int Invert_pitch
 
int Invert_roll
 
int Invert_thrust
 
int Disable_axis2
 
int Disable_axis3
 
int Axis_map_to []
 
int Invert_axis []
 
int Invert_axis_defaults []
 
int Control_config_overlay_id
 
config_item Control_config []
 Stores the keyboard configuration. More...
 
SCP_vector< config_item * > Control_config_presets
 
SCP_vector< SCP_stringControl_config_preset_names
 
char ** Scan_code_text
 
char ** Joy_button_text
 

Macro Definition Documentation

#define CONTROL_CONFIG_XSTR   507

Definition at line 16 of file controlsconfig.h.

Typedef Documentation

typedef struct config_item config_item

Control configuration item type.

Enumeration Type Documentation

enum CC_type

Control Configuration Types. Namely differ in how the control is activated

Enumerator
CC_TYPE_TRIGGER 

A normal, one-shot type control that is activated when a key is or button is pressed.

CC_TYPE_CONTINUOUS 

A continous control that is activated as long as the key or button is held down.

Definition at line 53 of file controlsconfig.h.

enum IoActionId

All available actions This is the value of the id field in config_item The first group of items are ship targeting.

Enumerator
TARGET_NEXT 

target next

TARGET_PREV 

target previous

TARGET_NEXT_CLOSEST_HOSTILE 

target the next hostile target

TARGET_PREV_CLOSEST_HOSTILE 

target the previous closest hostile

TOGGLE_AUTO_TARGETING 

toggle auto-targeting

TARGET_NEXT_CLOSEST_FRIENDLY 

target the next friendly ship

TARGET_PREV_CLOSEST_FRIENDLY 

target the closest friendly ship

TARGET_SHIP_IN_RETICLE 

target ship closest to center of reticle

TARGET_CLOSEST_SHIP_ATTACKING_TARGET 

target the closest ship attacking current target

TARGET_LAST_TRANMISSION_SENDER 

TARGET_LAST_TRANMISSION_SENDER.

STOP_TARGETING_SHIP 

stop targeting ship


Targeting a Ship's Subsystem

TARGET_SUBOBJECT_IN_RETICLE 

target ships subsystem in reticle

TARGET_NEXT_SUBOBJECT 

target next subsystem on current target

TARGET_PREV_SUBOBJECT 

TARGET_PREV_SUBOBJECT.

STOP_TARGETING_SUBSYSTEM 

stop targeting subsystems on ship


Speed Matching

MATCH_TARGET_SPEED 

match target speed

TOGGLE_AUTO_MATCH_TARGET_SPEED 

toggle auto-match target speed


Weapons

FIRE_PRIMARY 

FIRE_PRIMARY.

FIRE_SECONDARY 

FIRE_SECONDARY.

CYCLE_NEXT_PRIMARY 

cycle to next primary weapon

CYCLE_PREV_PRIMARY 

cycle to previous primary weapon

CYCLE_SECONDARY 

cycle to next secondary weapon

CYCLE_NUM_MISSLES 

cycle number of missiles fired from secondary bank

LAUNCH_COUNTERMEASURE 

LAUNCH_COUNTERMEASURE.


Controls

FORWARD_THRUST 

FORWARD_THRUST.

REVERSE_THRUST 

REVERSE_THRUST.

BANK_LEFT 

BANK_LEFT.

BANK_RIGHT 

BANK_RIGHT.

PITCH_FORWARD 

PITCH_FORWARD.

PITCH_BACK 

PITCH_BACK.

YAW_LEFT 

YAW_LEFT.

YAW_RIGHT 

YAW_RIGHT.


Throttle Control

ZERO_THROTTLE 

ZERO_THROTTLE.

MAX_THROTTLE 

MAX_THROTTLE.

ONE_THIRD_THROTTLE 

ONE_THIRD_THROTTLE.

TWO_THIRDS_THROTTLE 

TWO_THIRDS_THROTTLE.

PLUS_5_PERCENT_THROTTLE 

PLUS_5_PERCENT_THROTTLE.

MINUS_5_PERCENT_THROTTLE 

MINUS_5_PERCENT_THROTTLE.


Squadmate Messaging Keys

ATTACK_MESSAGE 

wingman message: attack current target

DISARM_MESSAGE 

wingman message: disarm current target

DISABLE_MESSAGE 

wingman message: disable current target

ATTACK_SUBSYSTEM_MESSAGE 

wingman message: disable current target

CAPTURE_MESSAGE 

wingman message: capture current target

ENGAGE_MESSAGE 

wingman message: engage enemy

FORM_MESSAGE 

wingman message: form on my wing

IGNORE_MESSAGE 

IGNORE_MESSAGE.

PROTECT_MESSAGE 

wingman message: protect current target

COVER_MESSAGE 

wingman message: cover me

WARP_MESSAGE 

wingman message: warp out

REARM_MESSAGE 

REARM_MESSAGE.

TARGET_CLOSEST_SHIP_ATTACKING_SELF 

target closest ship that is attacking player


Views

VIEW_CHASE 

VIEW_CHASE.

VIEW_EXTERNAL 

VIEW_EXTERNAL.

VIEW_EXTERNAL_TOGGLE_CAMERA_LOCK 

VIEW_EXTERNAL_TOGGLE_CAMERA_LOCK.

VIEW_SLEW 

VIEW_SLEW.

VIEW_OTHER_SHIP 

VIEW_OTHER_SHIP.

VIEW_DIST_INCREASE 

VIEW_DIST_INCREASE.

VIEW_DIST_DECREASE 

VIEW_DIST_DECREASE.

VIEW_CENTER 

VIEW_CENTER.

PADLOCK_UP 

PADLOCK_UP.

PADLOCK_DOWN 

PADLOCK_DOWN.

PADLOCK_LEFT 

PADLOCK_LEFT.

PADLOCK_RIGHT 

PADLOCK_RIGHT.


Misc Controls 1

RADAR_RANGE_CYCLE 

cycle to next radar range

SQUADMSG_MENU 

toggle the squadmate messaging menu

SHOW_GOALS 

show the mission goals screen

END_MISSION 

end the mission

TARGET_TARGETS_TARGET 

target your target's target

AFTERBURNER 

AFTERBURNER.


ETS

INCREASE_WEAPON 

increase weapon recharge rate

DECREASE_WEAPON 

decrease weapon recharge rate

INCREASE_SHIELD 

increase shield recharge rate

DECREASE_SHIELD 

decrease shield recharge rate

INCREASE_ENGINE 

increase energy to engines

DECREASE_ENGINE 

decrease energy to engines

ETS_EQUALIZE 

equalize recharge rates

SHIELD_EQUALIZE 

equalize shield energy to all quadrants

SHIELD_XFER_TOP 

transfer shield energy to front

SHIELD_XFER_BOTTOM 

transfer shield energy to rear

SHIELD_XFER_LEFT 

transfer shield energy to left

SHIELD_XFER_RIGHT 

transfer shield energy to right

XFER_SHIELD 

transfer energy to shield from weapons

XFER_LASER 

transfer energy to weapons from shield


Misc Controls 2

GLIDE_WHEN_PRESSED 

GLIDE_WHEN_PRESSED

Remarks
Backslash – this was a convenient place for Glide When Pressed, since Show Damage Popup isn't used
BANK_WHEN_PRESSED 

BANK_WHEN_PRESSED.

SHOW_NAVMAP 

SHOW_NAVMAP.

ADD_REMOVE_ESCORT 

ADD_REMOVE_ESCORT.

ESCORT_CLEAR 

ESCORT_CLEAR.

TARGET_NEXT_ESCORT_SHIP 

TARGET_NEXT_ESCORT_SHIP.

TARGET_CLOSEST_REPAIR_SHIP 

target the closest repair ship

TARGET_NEXT_UNINSPECTED_CARGO 

TARGET_NEXT_UNINSPECTED_CARGO.

TARGET_PREV_UNINSPECTED_CARGO 

TARGET_PREV_UNINSPECTED_CARGO.

TARGET_NEWEST_SHIP 

TARGET_NEWEST_SHIP.

TARGET_NEXT_LIVE_TURRET 

TARGET_NEXT_LIVE_TURRET.

TARGET_PREV_LIVE_TURRET 

TARGET_PREV_LIVE_TURRET.

TARGET_NEXT_BOMB 

TARGET_NEXT_BOMB.

TARGET_PREV_BOMB 

TARGET_PREV_BOMB.


Multiplayer messaging keys

MULTI_MESSAGE_ALL 

message all netplayers

MULTI_MESSAGE_FRIENDLY 

message all friendlies

MULTI_MESSAGE_HOSTILE 

message all hostiles

MULTI_MESSAGE_TARGET 

message targeted ship (if player)


Multiplayer misc keys

MULTI_OBSERVER_ZOOM_TO 

if i'm an observer, zoom to my targeted object

TIME_SPEED_UP 

TIME_SPEED_UP.

TIME_SLOW_DOWN 

TIME_SLOW_DOWN.

TOGGLE_HUD_CONTRAST 

toggle between high and low HUD contrast

MULTI_TOGGLE_NETINFO 

toggle network info

MULTI_SELF_DESTRUCT 

self destruct (multiplayer only)


Misc Controls 3

TOGGLE_HUD 

TOGGLE_HUD.

RIGHT_SLIDE_THRUST 

RIGHT_SLIDE_THRUST.

LEFT_SLIDE_THRUST 

LEFT_SLIDE_THRUST.

UP_SLIDE_THRUST 

UP_SLIDE_THRUST.

DOWN_SLIDE_THRUST 

DOWN_SLIDE_THRUST.

HUD_TARGETBOX_TOGGLE_WIREFRAME 

HUD_TARGETBOX_TOGGLE_WIREFRAME.

VIEW_TOPDOWN 

VIEW_TOPDOWN.

VIEW_TRACK_TARGET 

VIEW_TRACK_TARGET.


AutoPilot - Kazan

AUTO_PILOT_TOGGLE 

Autopilot key control.

NAV_CYCLE 

NAV_CYCLE.


Gliding

TOGGLE_GLIDING 

TOGGLE_GLIDING.


Additional weapon controls

CYCLE_PRIMARY_WEAPON_SEQUENCE 

cycle num primaries to fire at once

CCFG_MAX 

The total number of defined control actions (or last define + 1)

This must always be below the last defined item

Definition at line 80 of file controlsconfig.h.

These are used to index a corresponding (analog) action, namely controlling the orientation angles and throttle.

Enumerator
JOY_HEADING_AXIS 
JOY_PITCH_AXIS 
JOY_BANK_AXIS 
JOY_ABS_THROTTLE_AXIS 
JOY_REL_THROTTLE_AXIS 
NUM_JOY_AXIS_ACTIONS 

The total number of actions an axis may map to.

This must always be below the last defined item

Definition at line 35 of file controlsconfig.h.

These are used to index a corresponding joystick axis value from an array. Currently only used by Axis_map_to[] and Axis_map_to_defaults[]

Enumerator
JOY_X_AXIS 
JOY_Y_AXIS 
JOY_Z_AXIS 
JOY_RX_AXIS 
JOY_RY_AXIS 
JOY_RZ_AXIS 

Definition at line 22 of file controlsconfig.h.

Function Documentation

int check_control ( int  id,
int  key 
)

Wrapper for check_control_used. Allows the game to ignore the key if told to do so by the ignore-key SEXP.

Definition at line 2273 of file controlsconfig.cpp.

float check_control_timef ( int  id)

Definition at line 2149 of file controlsconfig.cpp.

void clear_key_binding ( short  key)

Definition at line 2138 of file controlsconfig.cpp.

void control_check_indicate ( )

Definition at line 2185 of file controlsconfig.cpp.

void control_config_cancel_exit ( )

Definition at line 1161 of file controlsconfig.cpp.

void control_config_clear ( )

Definition at line 2384 of file controlsconfig.cpp.

void control_config_clear_used_status ( )

Definition at line 2375 of file controlsconfig.cpp.

void control_config_close ( )

Definition at line 1368 of file controlsconfig.cpp.

void control_config_common_close ( )

close common control config stuff - call at game shutdown

Definition at line 616 of file controlsconfigcommon.cpp.

void control_config_common_init ( )

initialize common control config stuff - call at game startup after localization has been initialized

Definition at line 590 of file controlsconfigcommon.cpp.

void control_config_do_frame ( float  frametime)

Definition at line 1424 of file controlsconfig.cpp.

void control_config_init ( )

Definition at line 1266 of file controlsconfig.cpp.

void control_config_reset_defaults ( int  presetnum = -1)

Definition at line 932 of file controlsconfig.cpp.

void control_get_axes_readings ( int h,
int p,
int b,
int ta,
int tr 
)

Definition at line 2300 of file controlsconfig.cpp.

void control_used ( int  id)

Definition at line 2352 of file controlsconfig.cpp.

char* textify_scancode ( int  code)

Definition at line 552 of file controlsconfigcommon.cpp.

char* translate_key ( char *  key)

Given the system default key 'key', return the current key that is bound to that function. Both are 'key' and the return value are descriptive strings that can be displayed directly to the user. If 'key' isn't a real key, is not normally bound to anything, or there is no key currently bound to the function, NULL is returned.

Definition at line 506 of file controlsconfigcommon.cpp.

int translate_key_to_index ( const char *  key,
bool  find_override = true 
)

Definition at line 437 of file controlsconfigcommon.cpp.

Variable Documentation

int Axis_map_to[]

Definition at line 146 of file controlsconfig.cpp.

config_item Control_config[]

Stores the keyboard configuration.

arrays which hold the key mappings. The array index represents a key-independent action. please use SPACES for aligning the fields of this array

Definition at line 46 of file controlsconfigcommon.cpp.

int Control_config_overlay_id

Definition at line 182 of file controlsconfig.cpp.

SCP_vector<SCP_string> Control_config_preset_names

Definition at line 407 of file controlsconfigcommon.cpp.

SCP_vector<config_item*> Control_config_presets

Definition at line 406 of file controlsconfigcommon.cpp.

int Disable_axis2
int Disable_axis3
int Failed_key_index

Definition at line 31 of file controlsconfigcommon.cpp.

int Invert_axis[]

Definition at line 40 of file controlsconfigcommon.cpp.

int Invert_axis_defaults[]

Definition at line 41 of file controlsconfigcommon.cpp.

int Invert_heading
int Invert_pitch
int Invert_roll
int Invert_thrust
char** Joy_button_text

Definition at line 404 of file controlsconfigcommon.cpp.

char** Scan_code_text

Definition at line 403 of file controlsconfigcommon.cpp.