Hotkey commands can be loaded from configuration objects. When a keyboard event corresponding to a hotkey occurs, a command_executor object can execute the hotkeys actions. For this to work, key_event() must be called whenever a keyboard event happens.
enum hotkey::ACTION_STATE |
Definition at line 31 of file hotkeys.hpp.
static void hotkey::_get_visible_hotkey_itor | ( | int | index, | |
std::vector< hotkey_item >::iterator & | itor | |||
) | [static] |
Definition at line 477 of file hotkeys.cpp.
References hotkeys_.
Referenced by get_visible_hotkey().
void hotkey::execute_command | ( | display & | disp, | |
HOTKEY_COMMAND | command, | |||
command_executor * | executor, | |||
int | index | |||
) |
Definition at line 801 of file hotkeys.cpp.
References _, hotkey::command_executor::can_execute_command(), DBG_G, preferences::enable_mouse_scroll(), hotkey::command_executor::execute_command(), preferences::fullscreen(), get_next_filename(), get_screenshot_dir(), HOTKEY_ACCELERATED, HOTKEY_FULLSCREEN, HOTKEY_MAP_SCREENSHOT, HOTKEY_MOUSE_SCROLL, HOTKEY_MUTE, HOTKEY_QUIT_GAME, HOTKEY_SCREENSHOT, HOTKEY_ZOOM_DEFAULT, HOTKEY_ZOOM_IN, HOTKEY_ZOOM_OUT, display::in_editor(), display::in_game(), gui::MESSAGE, preferences::mouse_scroll_enabled(), preferences::music_on(), name, QUIT, display::screenshot(), display::set_default_zoom(), preferences::set_fullscreen(), preferences::set_music(), preferences::set_sound(), preferences::set_turbo(), display::set_zoom(), size, preferences::sound_on(), preferences::turbo(), and gui::YES_NO.
Referenced by map_editor::execute_command(), key_event_execute(), and hotkey::command_executor::show_menu().
hotkey_item & hotkey::get_hotkey | ( | const SDL_KeyboardEvent & | event | ) |
hotkey_item & hotkey::get_hotkey | ( | int | character, | |
int | keycode, | |||
bool | shift, | |||
bool | ctrl, | |||
bool | alt, | |||
bool | cmd | |||
) |
Definition at line 408 of file hotkeys.cpp.
References hotkey::hotkey_item::BY_CHARACTER, hotkey::hotkey_item::BY_KEYCODE, DBG_G, hotkeys_, lexical_cast(), and null_hotkey_.
hotkey_item & hotkey::get_hotkey | ( | const std::string & | command | ) |
hotkey_item & hotkey::get_hotkey | ( | HOTKEY_COMMAND | id | ) |
Definition at line 378 of file hotkeys.cpp.
References hotkeys_, and null_hotkey_.
Referenced by get_hotkey(), hotkey::command_executor::get_menu_images(), key_event_execute(), map_editor::left_button_func_changed(), load_hotkeys(), move_unit(), preferences::show_hotkeys_dialog(), play_controller::show_menu(), hotkey::command_executor::show_menu(), and map_editor::show_menu().
std::vector< hotkey_item > & hotkey::get_hotkeys | ( | ) |
Definition at line 502 of file hotkeys.cpp.
References hotkeys_.
Referenced by preferences::show_hotkeys_dialog().
hotkey_item & hotkey::get_visible_hotkey | ( | int | index | ) |
Definition at line 491 of file hotkeys.cpp.
References _get_visible_hotkey_itor(), hotkeys_, and null_hotkey_.
Referenced by preferences::show_hotkeys_dialog().
void hotkey::key_event | ( | display & | disp, | |
const SDL_KeyboardEvent & | event, | |||
command_executor * | executor | |||
) |
Definition at line 524 of file hotkeys.cpp.
References _, ERR_G, display::in_game(), key_event_execute(), QUIT, and gui::YES_NO.
Referenced by play_controller::handle_event(), hotkey::basic_handler::handle_event(), and map_editor::handle_keyboard_event().
void hotkey::key_event_execute | ( | display & | disp, | |
const SDL_KeyboardEvent & | event, | |||
command_executor * | executor | |||
) | [static] |
Definition at line 539 of file hotkeys.cpp.
References execute_command(), get_hotkey(), hotkey::hotkey_item::get_id(), and hotkey::hotkey_item::null().
Referenced by hotkey::basic_handler::handle_event(), and key_event().
void hotkey::load_descriptions | ( | ) |
Definition at line 327 of file hotkeys.cpp.
References description, dsgettext(), ERR_G, hotkey_list_, hotkeys_, and PACKAGE.
Referenced by map_editor::change_language(), and map_editor::map_editor().
void hotkey::load_hotkeys | ( | const config & | cfg | ) |
Definition at line 337 of file hotkeys.cpp.
References config::get_children(), get_hotkey(), hotkey::hotkey_item::get_id(), HOTKEY_NULL, and hotkey::hotkey_item::load_from_config().
Referenced by preferences::load_hotkeys(), and map_editor::map_editor().
void hotkey::save_hotkeys | ( | config & | cfg | ) |
Definition at line 349 of file hotkeys.cpp.
References config::add_child(), hotkey::hotkey_item::BY_CHARACTER, hotkey::hotkey_item::BY_KEYCODE, config::clear_children(), hotkey::hotkey_item::CLEARED, CLEARED_TEXT, hotkeys_, and hotkey::hotkey_item::UNBOUND.
Referenced by preferences::save_hotkeys(), preferences::show_hotkeys_dialog(), and map_editor::~map_editor().
const std::string hotkey::CLEARED_TEXT = "__none__" |
Definition at line 161 of file hotkeys.cpp.
Referenced by hotkey::hotkey_item::load_from_config(), and save_hotkeys().
Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |