The Battle for Wesnoth  1.19.5+dev
Classes | Namespaces | Typedefs | Functions
hotkey_item.hpp File Reference
#include <SDL2/SDL_events.h>
#include <memory>
#include <vector>
#include <string>
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.

Classes

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...
 

Namespaces

 hotkey
 Keyboard shortcuts for game actions.
 

Typedefs

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

Functions

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 (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_default_hotkeys (const game_config_view &cfg)
 Registers all hotkeys present in this config. More...
 
void hotkey::load_custom_hotkeys (const game_config_view &cfg)
 Registers all hotkeys present in this config, overwriting any matching default hotkeys. 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)