The Battle for Wesnoth  1.15.12+dev
Classes | Namespaces | Typedefs | Functions
hotkey_item.hpp File Reference
#include <SDL2/SDL_events.h>
#include <SDL2/SDL.h>
#include <memory>
#include <vector>
#include <string>
#include <boost/algorithm/string.hpp>
Include dependency graph for hotkey_item.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


class  hotkey::hotkey_base
 This is the base class for hotkey event matching. More...
class  hotkey::hotkey_keyboard
 This class is responsible for handling keys, not modifiers. More...
class  hotkey::hotkey_void
 This class is used to return non-valid results in order to save other people from null checks. More...
class  hotkey::hotkey_mouse
 This class is responsible for handling mouse button presses. More...


 Keyboard shortcuts for game actions.


typedef std::shared_ptr< hotkey_base > hotkey::hotkey_ptr
typedef std::shared_ptr< hotkey_mouse > hotkey::hotkey_mouse_ptr
typedef std::shared_ptr< hotkey_keyboard > hotkey::hotkey_keyboard_ptr
typedef std::vector< hotkey::hotkey_ptrhotkey::hotkey_list
typedef std::vector< hotkey::hotkey_ptr >::iterator hotkey::hotkey_list_iter


hotkey_ptr hotkey::load_from_config (const config &cfg)
 Create and instantiate a hotkey from a config element. More...
bool hotkey::has_hotkey_item (const std::string &command)
void hotkey::add_hotkey (const hotkey_ptr item)
 Add a hotkey to the list of hotkeys. More...
void hotkey::del_hotkey (const hotkey_ptr item)
 Remove a hotkey from the list of hotkeys. More...
hotkey_ptr hotkey::create_hotkey (const std::string &id, const SDL_Event &event)
 Create a new hotkey item for a command from an SDL_Event. More...
const hotkey_ptr hotkey::get_hotkey (const SDL_Event &event)
 Iterate through the list of hotkeys and return a hotkey that matches the SDL_Event and the current keyboard modifier state. More...
void hotkey::load_hotkeys (const game_config_view &cfg, bool set_as_default=false)
 Iterates through all hotkeys present in the config struct and creates and adds them to the hotkey list. More...
void hotkey::reset_default_hotkeys ()
 Reset all hotkeys to the defaults. More...
const hotkey_list & hotkey::get_hotkeys ()
 Returns the list of hotkeys. More...
void hotkey::clear_hotkeys (const std::string &command)
 Unset the command bindings for all hotkeys matching the command. More...
void hotkey::clear_hotkeys ()
 Unset the bindings for all hotkeys. More...
std::string hotkey::get_names (const std::string &id)
 Returns a comma-separated string of hotkey names. More...
void hotkey::save_hotkeys (config &cfg)
 Save the non-default hotkeys to the config. More...
bool hotkey::is_hotkeyable_event (const SDL_Event &event)