The Battle for Wesnoth  1.15.0+dev
Classes | Namespaces | Typedefs | Enumerations | Functions
hotkey_command.hpp File Reference
#include "tooltips.hpp"
#include "tstring.hpp"
#include <bitset>
#include <list>
#include <map>
#include <vector>
Include dependency graph for hotkey_command.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  hotkey::hotkey_command_temp
 Do not use this outside hotkeys.cpp. More...
 
struct  hotkey::hotkey_command
 Stores all information related to functions that can be bound to hotkeys. More...
 
class  hotkey::scope_changer
 

Namespaces

 hotkey
 Keyboard shortcuts for game actions.
 

Typedefs

using hotkey::category_name_map_t = std::map< HOTKEY_CATEGORY, std::string >
 
typedef std::bitset< SCOPE_COUNT > hotkey::hk_scopes
 

Enumerations

enum  hotkey::scope { hotkey::SCOPE_MAIN_MENU, hotkey::SCOPE_GAME, hotkey::SCOPE_EDITOR, hotkey::SCOPE_COUNT }
 Available hotkey scopes. More...
 
enum  hotkey::HOTKEY_COMMAND {
  hotkey::HOTKEY_CYCLE_UNITS, hotkey::HOTKEY_CYCLE_BACK_UNITS, hotkey::HOTKEY_UNIT_HOLD_POSITION, hotkey::HOTKEY_END_UNIT_TURN,
  hotkey::HOTKEY_LEADER, hotkey::HOTKEY_UNDO, hotkey::HOTKEY_REDO, hotkey::HOTKEY_ZOOM_IN,
  hotkey::HOTKEY_ZOOM_OUT, hotkey::HOTKEY_ZOOM_DEFAULT, hotkey::HOTKEY_FULLSCREEN, hotkey::HOTKEY_SCREENSHOT,
  hotkey::HOTKEY_MAP_SCREENSHOT, hotkey::HOTKEY_ACCELERATED, hotkey::HOTKEY_TERRAIN_DESCRIPTION, hotkey::HOTKEY_UNIT_DESCRIPTION,
  hotkey::HOTKEY_RENAME_UNIT, hotkey::HOTKEY_DELETE_UNIT, hotkey::HOTKEY_SAVE_GAME, hotkey::HOTKEY_SAVE_REPLAY,
  hotkey::HOTKEY_SAVE_MAP, hotkey::HOTKEY_LOAD_GAME, hotkey::HOTKEY_RECRUIT, hotkey::HOTKEY_REPEAT_RECRUIT,
  hotkey::HOTKEY_RECALL, hotkey::HOTKEY_ENDTURN, hotkey::HOTKEY_TOGGLE_ELLIPSES, hotkey::HOTKEY_TOGGLE_GRID,
  hotkey::HOTKEY_STATUS_TABLE, hotkey::HOTKEY_MUTE, hotkey::HOTKEY_MOUSE_SCROLL, hotkey::HOTKEY_SPEAK,
  hotkey::HOTKEY_CREATE_UNIT, hotkey::HOTKEY_CHANGE_SIDE, hotkey::HOTKEY_KILL_UNIT, hotkey::HOTKEY_PREFERENCES,
  hotkey::HOTKEY_OBJECTIVES, hotkey::HOTKEY_UNIT_LIST, hotkey::HOTKEY_STATISTICS, hotkey::HOTKEY_STOP_NETWORK,
  hotkey::HOTKEY_START_NETWORK, hotkey::HOTKEY_SURRENDER, hotkey::HOTKEY_QUIT_GAME, hotkey::HOTKEY_QUIT_TO_DESKTOP,
  hotkey::HOTKEY_LABEL_TEAM_TERRAIN, hotkey::HOTKEY_LABEL_TERRAIN, hotkey::HOTKEY_CLEAR_LABELS, hotkey::HOTKEY_SHOW_ENEMY_MOVES,
  hotkey::HOTKEY_BEST_ENEMY_MOVES, hotkey::HOTKEY_DELAY_SHROUD, hotkey::HOTKEY_UPDATE_SHROUD, hotkey::HOTKEY_CONTINUE_MOVE,
  hotkey::HOTKEY_SEARCH, hotkey::HOTKEY_SPEAK_ALLY, hotkey::HOTKEY_SPEAK_ALL, hotkey::HOTKEY_HELP,
  hotkey::HOTKEY_HELP_ABOUT_SAVELOAD, hotkey::HOTKEY_CHAT_LOG, hotkey::HOTKEY_LANGUAGE, hotkey::HOTKEY_ANIMATE_MAP,
  hotkey::HOTKEY_REPLAY_PLAY, hotkey::HOTKEY_REPLAY_RESET, hotkey::HOTKEY_REPLAY_STOP, hotkey::HOTKEY_REPLAY_NEXT_TURN,
  hotkey::HOTKEY_REPLAY_NEXT_SIDE, hotkey::HOTKEY_REPLAY_NEXT_MOVE, hotkey::HOTKEY_REPLAY_SHOW_EVERYTHING, hotkey::HOTKEY_REPLAY_SHOW_EACH,
  hotkey::HOTKEY_REPLAY_SHOW_TEAM1, hotkey::HOTKEY_REPLAY_SKIP_ANIMATION, hotkey::HOTKEY_REPLAY_EXIT, hotkey::HOTKEY_SELECT_HEX,
  hotkey::HOTKEY_DESELECT_HEX, hotkey::HOTKEY_MOVE_ACTION, hotkey::HOTKEY_SELECT_AND_ACTION, hotkey::HOTKEY_TOUCH_HEX,
  hotkey::HOTKEY_SCROLL_UP, hotkey::HOTKEY_SCROLL_DOWN, hotkey::HOTKEY_SCROLL_LEFT, hotkey::HOTKEY_SCROLL_RIGHT,
  hotkey::HOTKEY_CANCEL, hotkey::HOTKEY_OKAY, hotkey::HOTKEY_WB_TOGGLE, hotkey::HOTKEY_WB_EXECUTE_ACTION,
  hotkey::HOTKEY_WB_EXECUTE_ALL_ACTIONS, hotkey::HOTKEY_WB_DELETE_ACTION, hotkey::HOTKEY_WB_BUMP_UP_ACTION, hotkey::HOTKEY_WB_BUMP_DOWN_ACTION,
  hotkey::HOTKEY_WB_SUPPOSE_DEAD, hotkey::HOTKEY_USER_CMD, hotkey::HOTKEY_CUSTOM_CMD, hotkey::HOTKEY_AI_FORMULA,
  hotkey::HOTKEY_CLEAR_MSG, hotkey::HOTKEY_LABEL_SETTINGS, hotkey::HOTKEY_MINIMAP_CODING_TERRAIN, hotkey::HOTKEY_MINIMAP_CODING_UNIT,
  hotkey::HOTKEY_MINIMAP_DRAW_UNITS, hotkey::HOTKEY_MINIMAP_DRAW_VILLAGES, hotkey::HOTKEY_MINIMAP_DRAW_TERRAIN, hotkey::TITLE_SCREEN__RELOAD_WML,
  hotkey::TITLE_SCREEN__NEXT_TIP, hotkey::TITLE_SCREEN__PREVIOUS_TIP, hotkey::TITLE_SCREEN__TUTORIAL, hotkey::TITLE_SCREEN__CAMPAIGN,
  hotkey::TITLE_SCREEN__MULTIPLAYER, hotkey::TITLE_SCREEN__ADDONS, hotkey::TITLE_SCREEN__CORES, hotkey::TITLE_SCREEN__EDITOR,
  hotkey::TITLE_SCREEN__CREDITS, hotkey::TITLE_SCREEN__TEST, hotkey::GLOBAL__HELPTIP, hotkey::LUA_CONSOLE,
  hotkey::HOTKEY_WML, hotkey::HOTKEY_EDITOR_CUSTOM_TODS, hotkey::HOTKEY_EDITOR_PARTIAL_UNDO, hotkey::HOTKEY_EDITOR_PALETTE_ITEM_SWAP,
  hotkey::HOTKEY_EDITOR_PALETTE_ITEMS_CLEAR, hotkey::HOTKEY_EDITOR_PALETTE_GROUPS, hotkey::HOTKEY_EDITOR_PALETTE_UPSCROLL, hotkey::HOTKEY_EDITOR_PALETTE_DOWNSCROLL,
  hotkey::HOTKEY_EDITOR_REMOVE_LOCATION, hotkey::HOTKEY_EDITOR_PLAYLIST, hotkey::HOTKEY_EDITOR_SCHEDULE, hotkey::HOTKEY_EDITOR_LOCAL_TIME,
  hotkey::HOTKEY_EDITOR_UNIT_FACING, hotkey::HOTKEY_EDITOR_UNIT_TOGGLE_CANRECRUIT, hotkey::HOTKEY_EDITOR_UNIT_TOGGLE_RENAMEABLE, hotkey::HOTKEY_EDITOR_UNIT_CHANGE_ID,
  hotkey::HOTKEY_EDITOR_UNIT_TOGGLE_LOYAL, hotkey::HOTKEY_EDITOR_UNIT_RECRUIT_ASSIGN, hotkey::HOTKEY_EDITOR_BRUSH_NEXT, hotkey::HOTKEY_EDITOR_BRUSH_DEFAULT,
  hotkey::HOTKEY_EDITOR_BRUSH_1, hotkey::HOTKEY_EDITOR_BRUSH_2, hotkey::HOTKEY_EDITOR_BRUSH_3, hotkey::HOTKEY_EDITOR_BRUSH_SW_NE,
  hotkey::HOTKEY_EDITOR_BRUSH_NW_SE, hotkey::HOTKEY_EDITOR_TOOL_NEXT, hotkey::HOTKEY_EDITOR_TOOL_PAINT, hotkey::HOTKEY_EDITOR_TOOL_FILL,
  hotkey::HOTKEY_EDITOR_TOOL_SELECT, hotkey::HOTKEY_EDITOR_TOOL_STARTING_POSITION, hotkey::HOTKEY_EDITOR_TOOL_LABEL, hotkey::HOTKEY_EDITOR_TOOL_UNIT,
  hotkey::HOTKEY_EDITOR_TOOL_VILLAGE, hotkey::HOTKEY_EDITOR_TOOL_ITEM, hotkey::HOTKEY_EDITOR_TOOL_SOUNDSOURCE, hotkey::HOTKEY_EDITOR_SELECT_ALL,
  hotkey::HOTKEY_EDITOR_SELECT_INVERSE, hotkey::HOTKEY_EDITOR_SELECT_NONE, hotkey::HOTKEY_EDITOR_CLIPBOARD_PASTE, hotkey::HOTKEY_EDITOR_CLIPBOARD_ROTATE_CW,
  hotkey::HOTKEY_EDITOR_CLIPBOARD_ROTATE_CCW, hotkey::HOTKEY_EDITOR_CLIPBOARD_FLIP_HORIZONTAL, hotkey::HOTKEY_EDITOR_CLIPBOARD_FLIP_VERTICAL, hotkey::HOTKEY_EDITOR_SELECTION_CUT,
  hotkey::HOTKEY_EDITOR_SELECTION_COPY, hotkey::HOTKEY_EDITOR_SELECTION_ROTATE, hotkey::HOTKEY_EDITOR_SELECTION_FLIP, hotkey::HOTKEY_EDITOR_SELECTION_FILL,
  hotkey::HOTKEY_EDITOR_SELECTION_EXPORT, hotkey::HOTKEY_EDITOR_SELECTION_GENERATE, hotkey::HOTKEY_EDITOR_SELECTION_RANDOMIZE, hotkey::HOTKEY_EDITOR_MAP_NEW,
  hotkey::HOTKEY_EDITOR_MAP_LOAD, hotkey::HOTKEY_EDITOR_MAP_SAVE, hotkey::HOTKEY_EDITOR_MAP_SAVE_AS, hotkey::HOTKEY_EDITOR_MAP_SAVE_ALL,
  hotkey::HOTKEY_EDITOR_MAP_REVERT, hotkey::HOTKEY_EDITOR_MAP_INFO, hotkey::HOTKEY_EDITOR_MAP_CLOSE, hotkey::HOTKEY_EDITOR_MAP_SWITCH,
  hotkey::HOTKEY_EDITOR_MAP_RESIZE, hotkey::HOTKEY_EDITOR_MAP_ROTATE, hotkey::HOTKEY_EDITOR_MAP_GENERATE, hotkey::HOTKEY_EDITOR_MAP_APPLY_MASK,
  hotkey::HOTKEY_EDITOR_MAP_CREATE_MASK_TO, hotkey::HOTKEY_EDITOR_UPDATE_TRANSITIONS, hotkey::HOTKEY_EDITOR_TOGGLE_TRANSITIONS, hotkey::HOTKEY_EDITOR_AUTO_UPDATE_TRANSITIONS,
  hotkey::HOTKEY_EDITOR_PARTIAL_UPDATE_TRANSITIONS, hotkey::HOTKEY_EDITOR_NO_UPDATE_TRANSITIONS, hotkey::HOTKEY_EDITOR_REFRESH, hotkey::HOTKEY_EDITOR_REFRESH_IMAGE_CACHE,
  hotkey::HOTKEY_EDITOR_DRAW_COORDINATES, hotkey::HOTKEY_EDITOR_DRAW_TERRAIN_CODES, hotkey::HOTKEY_EDITOR_DRAW_NUM_OF_BITMAPS, hotkey::HOTKEY_EDITOR_SIDE_NEW,
  hotkey::HOTKEY_EDITOR_SIDE_EDIT, hotkey::HOTKEY_EDITOR_SIDE_REMOVE, hotkey::HOTKEY_EDITOR_AREA_REMOVE, hotkey::HOTKEY_EDITOR_AREA_ADD,
  hotkey::HOTKEY_EDITOR_AREA_SAVE, hotkey::HOTKEY_EDITOR_AREA_RENAME, hotkey::HOTKEY_EDITOR_SCENARIO_EDIT, hotkey::HOTKEY_EDITOR_SCENARIO_NEW,
  hotkey::HOTKEY_EDITOR_SCENARIO_SAVE_AS, hotkey::HOTKEY_NULL
}
 
enum  hotkey::HOTKEY_CATEGORY {
  hotkey::HKCAT_GENERAL, hotkey::HKCAT_SAVING, hotkey::HKCAT_MAP, hotkey::HKCAT_UNITS,
  hotkey::HKCAT_CHAT, hotkey::HKCAT_REPLAY, hotkey::HKCAT_WHITEBOARD, hotkey::HKCAT_SCENARIO,
  hotkey::HKCAT_PALETTE, hotkey::HKCAT_TOOLS, hotkey::HKCAT_CLIPBOARD, hotkey::HKCAT_DEBUG,
  hotkey::HKCAT_CUSTOM, hotkey::HKCAT_PLACEHOLDER
}
 

Functions

const category_name_map_t & hotkey::get_category_names ()
 Returns the map of hotkey categories and their display names. More...
 
std::list< HOTKEY_COMMAND > hotkey::get_hotkeys_by_category (HOTKEY_CATEGORY category)
 Returns a list of all the hotkeys belonging to the given category. More...
 
const std::vector< hotkey_command > & hotkey::get_hotkey_commands ()
 returns a container that contains all currently active hotkey_commands. More...
 
const hotkey_command & hotkey::get_hotkey_command (const std::string &command)
 returns the hotkey_command with the given name More...
 
const hotkey_command & hotkey::get_hotkey_null ()
 returns the hotkey_command that is treated as null. More...
 
void hotkey::deactivate_all_scopes ()
 
void hotkey::set_scope_active (scope s, bool set)
 
void hotkey::set_active_scopes (hk_scopes s)
 
bool hotkey::is_scope_active (scope s)
 
bool hotkey::is_scope_active (hk_scopes s)
 
bool hotkey::has_hotkey_command (const std::string &id)
 
void hotkey::add_wml_hotkey (const std::string &id, const t_string &description, const config &default_hotkey)
 adds a new wml hotkey to the list, but only if there is no hotkey with that id yet on the list. More...
 
void hotkey::delete_all_wml_hotkeys ()
 deletes all wml hotkeys, should be called after a game has ended More...
 
bool hotkey::remove_wml_hotkey (const std::string &id)
 removes a wml hotkey with the given id, returns true if the deletion was successful More...
 
const std::string & hotkey::get_description (const std::string &command)
 
const std::string & hotkey::get_tooltip (const std::string &command)
 
void hotkey::init_hotkey_commands ()
 
void hotkey::clear_hotkey_commands ()
 
HOTKEY_COMMAND hotkey::get_id (const std::string &command)
 returns get_hotkey_command(command).id More...