FS2_Open
Open source remastering of the Freespace 2 engine
|
#include <stdio.h>
#include <stdarg.h>
#include "cfile/cfile.h"
#include "controlconfig/controlsconfig.h"
#include "globalincs/def_files.h"
#include "globalincs/systemvars.h"
#include "io/joy.h"
#include "io/key.h"
#include "localization/localize.h"
#include "parse/parselo.h"
#include <map>
#include <string>
Go to the source code of this file.
Macros | |
#define | ADD_ENUM_TO_KEY_MAP(Enum) mKeyNameToVal[#Enum] = (Enum); |
#define | ADD_ENUM_TO_CCTYPE_MAP(Enum) mCCTypeNameToVal[#Enum] = (Enum); |
#define | ADD_ENUM_TO_CCTAB_MAP(Enum) mCCTabNameToVal[#Enum] = (Enum); |
Enumerations | |
enum | CC_tab { TARGET_TAB =0, SHIP_TAB =1, WEAPON_TAB =2, COMPUTER_TAB =3 } |
Functions | |
void | set_modifier_status () |
int | translate_key_to_index (const char *key, bool find_override) |
char * | translate_key (char *key) |
char * | textify_scancode (int code) |
void | control_config_common_load_overrides () |
Parses controlconfigdefault.tbl, and overrides the default control configuration for each valid entry in the .tbl. More... | |
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 | LoadEnumsIntoKeyMap (void) |
void | LoadEnumsIntoCCTypeMap (void) |
void | LoadEnumsIntoCCTabMap (void) |
void | LoadEnumsIntoMaps () |
#define ADD_ENUM_TO_CCTAB_MAP | ( | Enum | ) | mCCTabNameToVal[#Enum] = (Enum); |
#define ADD_ENUM_TO_CCTYPE_MAP | ( | Enum | ) | mCCTypeNameToVal[#Enum] = (Enum); |
#define ADD_ENUM_TO_KEY_MAP | ( | Enum | ) | mKeyNameToVal[#Enum] = (Enum); |
enum CC_tab |
Enumerator | |
---|---|
TARGET_TAB | |
SHIP_TAB | |
WEAPON_TAB | |
COMPUTER_TAB |
Definition at line 24 of file controlsconfigcommon.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_common_load_overrides | ( | ) |
Parses controlconfigdefault.tbl, and overrides the default control configuration for each valid entry in the .tbl.
short key_default; short joy_default; char tab; bool hasXSTR; char type;
Definition at line 806 of file controlsconfigcommon.cpp.
Helper function to LoadEnumsIntoMaps(), Loads the Control Tabs enumerations into mCCTabNameToVal
Definition at line 781 of file controlsconfigcommon.cpp.
Helper function to LoadEnumsIntoMaps(), Loads the Control Types enumerations into mCCTypeNameToVal
Definition at line 769 of file controlsconfigcommon.cpp.
Helper function to LoadEnumsIntoMaps(), Loads the Keyboard definitions/enumerations into mKeyNameToVal
Definition at line 633 of file controlsconfigcommon.cpp.
void LoadEnumsIntoMaps | ( | ) |
Loads the various control configuration maps to allow the parsing functions to appropriately map string tokns to their associated enumerations. The string tokens in the controlconfigdefaults.tbl match directly to their names in the C++ code, such as "KEY_5" in the .tbl mapping to the #define KEY_5 value
Definition at line 797 of file controlsconfigcommon.cpp.
void set_modifier_status | ( | ) |
Definition at line 409 of file controlsconfigcommon.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 | ||
) |
Definition at line 437 of file controlsconfigcommon.cpp.
int Alt_is_modifier |
Definition at line 36 of file controlsconfigcommon.cpp.
int Axis_enabled[JOY_NUM_AXES] = { 1, 1, 1, 0, 0, 0 } |
Definition at line 38 of file controlsconfigcommon.cpp.
int Axis_enabled_defaults[JOY_NUM_AXES] = { 1, 1, 1, 0, 0, 0 } |
Definition at line 39 of file controlsconfigcommon.cpp.
config_item Control_config[CCFG_MAX+1] |
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.
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 Ctrl_is_modifier |
Definition at line 35 of file controlsconfigcommon.cpp.
int Failed_key_index |
Definition at line 31 of file controlsconfigcommon.cpp.
int Invert_axis[JOY_NUM_AXES] = { 0, 0, 0, 0, 0, 0 } |
Definition at line 40 of file controlsconfigcommon.cpp.
int Invert_axis_defaults[JOY_NUM_AXES] = { 0, 0, 0, 0, 0, 0 } |
Definition at line 41 of file controlsconfigcommon.cpp.
char** Joy_button_text = Joy_button_text_english |
Definition at line 404 of file controlsconfigcommon.cpp.
char* Joy_button_text_english[] |
Definition at line 394 of file controlsconfigcommon.cpp.
char* Joy_button_text_french[] |
Definition at line 291 of file controlsconfigcommon.cpp.
char* Joy_button_text_german[] |
Definition at line 240 of file controlsconfigcommon.cpp.
char* Joy_button_text_polish[] |
Definition at line 342 of file controlsconfigcommon.cpp.
SCP_map<SCP_string, char> mCCTabNameToVal |
Definition at line 629 of file controlsconfigcommon.cpp.
SCP_map<SCP_string, CC_type> mCCTypeNameToVal |
Definition at line 628 of file controlsconfigcommon.cpp.
SCP_map<SCP_string, int> mKeyNameToVal |
Definition at line 627 of file controlsconfigcommon.cpp.
char** Scan_code_text = Scan_code_text_english |
Definition at line 403 of file controlsconfigcommon.cpp.
char* Scan_code_text_english[] |
This is the text that is displayed on the screen for the keys a player selects.
Definition at line 352 of file controlsconfigcommon.cpp.
char* Scan_code_text_french[] |
Definition at line 249 of file controlsconfigcommon.cpp.
char* Scan_code_text_german[] |
Definition at line 198 of file controlsconfigcommon.cpp.
char* Scan_code_text_polish[] |
Definition at line 300 of file controlsconfigcommon.cpp.
int Shift_is_modifier |
Definition at line 34 of file controlsconfigcommon.cpp.