The Battle for Wesnoth 1.21.0-dev
 
Loading...
Searching...
No Matches
Classes | Namespaces | Typedefs | Functions
hotkey_item.hpp File Reference
#include <SDL3/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

namespace  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_ptr > hotkey::hotkey_list
 

Functions

hotkey_ptr hotkey::load_from_config (const config &cfg)
 Create and instantiate a hotkey from a config element.
 
bool hotkey::has_hotkey_item (const std::string &command)
 
void hotkey::add_hotkey (hotkey_ptr item)
 Add a hotkey to the list of hotkeys.
 
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.
 
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.
 
void hotkey::load_default_hotkeys (const game_config_view &cfg)
 Registers all hotkeys present in this config.
 
void hotkey::load_custom_hotkeys (const game_config_view &cfg)
 Registers all hotkeys present in this config, overwriting any matching default hotkeys.
 
void hotkey::reset_default_hotkeys ()
 Reset all hotkeys to the defaults.
 
const hotkey_list & hotkey::get_hotkeys ()
 Returns the list of hotkeys.
 
void hotkey::clear_hotkeys (const std::string &command)
 Unset the command bindings for all hotkeys matching the command.
 
void hotkey::clear_hotkeys ()
 Unset the bindings for all hotkeys.
 
std::string hotkey::get_names (const std::string &id)
 Returns a comma-separated string of hotkey names.
 
void hotkey::save_hotkeys (config &cfg)
 Save the non-default hotkeys to the config.
 
bool hotkey::is_hotkeyable_event (const SDL_Event &event)