#include <keys.h>
Collaboration diagram for KeyBinder:
Public Member Functions | |
KeyBinder () | |
~KeyBinder () | |
void | AddKeyBinding (SDLKey sym, int mod, const Action *action, int nparams, int *params) |
void | DelKeyBinding (SDLKey sym, int mod) |
void | Flush () |
bool | DoAction (ActionType action, bool press) |
bool | HandleEvent (SDL_Event &ev) |
void | LoadFromFile (const char *filename) |
void | LoadDefaults () |
void | ShowHelp () |
void | ShowCheatHelp () |
Private Member Functions | |
void | ParseText (char *text, int len) |
void | ParseLine (char *line) |
void | FillParseMaps () |
Private Attributes | |
KeyMap | bindings |
std::vector< std::string > | keyhelp |
std::vector< std::string > | cheathelp |
Definition at line 50 of file keys.h.
KeyBinder::KeyBinder | ( | ) |
Definition at line 255 of file keys.cc.
References FillParseMaps().
Here is the call graph for this function:
void KeyBinder::AddKeyBinding | ( | SDLKey | sym, | |
int | mod, | |||
const Action * | action, | |||
int | nparams, | |||
int * | params | |||
) |
Definition at line 264 of file keys.cc.
References ActionType::action, bindings, c_maxparams, k, and ActionType::params.
Referenced by ParseLine().
void KeyBinder::DelKeyBinding | ( | SDLKey | sym, | |
int | mod | |||
) |
void KeyBinder::Flush | ( | ) | [inline] |
Definition at line 67 of file keys.h.
References bindings, cheathelp, and keyhelp.
Referenced by LoadDefaults(), and LoadFromFile().
bool KeyBinder::DoAction | ( | ActionType | action, | |
bool | press | |||
) |
Definition at line 284 of file keys.cc.
References ActionType::action, Action::allow_during_dont_move, cheat, Action::cheat, Action::func, Action::func_release, Action::game, Game::get_game_type(), Game_window::get_instance(), Cheat::in_map_editor(), Game_window::main_actor_dont_move(), NONE, and ActionType::params.
Referenced by HandleEvent().
Here is the call graph for this function:
bool KeyBinder::HandleEvent | ( | SDL_Event & | ev | ) |
Definition at line 308 of file keys.cc.
References bindings, and DoAction().
Referenced by Handle_event().
Here is the call graph for this function:
void KeyBinder::LoadFromFile | ( | const char * | filename | ) |
Definition at line 547 of file keys.cc.
References Flush(), ParseLine(), and U7open().
Referenced by Game_window::init_files().
Here is the call graph for this function:
void KeyBinder::LoadDefaults | ( | ) |
Definition at line 569 of file keys.cc.
References Flush(), game, Game::get_resource(), len, str_int_pair::num, ParseText(), U7object::retrieve(), and str_int_pair::str.
Referenced by Game_window::init_files().
Here is the call graph for this function:
void KeyBinder::ShowHelp | ( | ) |
Definition at line 337 of file keys.cc.
References Text_gump::add_text(), Get_click(), Game_window::get_instance(), Mouse::hand, keyhelp, Game_window::paint(), Scroll_gump::paint(), and Text_gump::show_next_page().
Referenced by ActionHelp().
Here is the call graph for this function:
void KeyBinder::ShowCheatHelp | ( | ) |
Definition at line 357 of file keys.cc.
References Text_gump::add_text(), cheathelp, Get_click(), Game_window::get_instance(), Mouse::hand, Game_window::paint(), Scroll_gump::paint(), and Text_gump::show_next_page().
Referenced by ActionCheatHelp().
Here is the call graph for this function:
void KeyBinder::ParseText | ( | char * | text, | |
int | len | |||
) | [private] |
Definition at line 377 of file keys.cc.
References ParseLine().
Referenced by LoadDefaults().
Here is the call graph for this function:
void KeyBinder::ParseLine | ( | char * | line | ) | [private] |
Definition at line 399 of file keys.cc.
References ActionType::action, actions, AddKeyBinding(), c_maxparams, chardata, Action::cheat, cheathelp, Action::desc, k, keyhelp, keys, ActionType::params, s, Action::show, skipspace(), to_uppercase(), and Chardata::whitespace.
Referenced by LoadFromFile(), and ParseText().
Here is the call graph for this function:
void KeyBinder::FillParseMaps | ( | ) | [private] |
Definition at line 586 of file keys.cc.
References actions, ExultActions, k, keys, s, and SDLKeyStringTable.
Referenced by KeyBinder().
KeyMap KeyBinder::bindings [private] |
std::vector<std::string> KeyBinder::keyhelp [private] |
std::vector<std::string> KeyBinder::cheathelp [private] |