class EE::UI::MouseBindings

Overview

#include <mouseshortcut.hpp>

class MouseBindings {
public:
    // typedefs

    typedef std::unordered_map<Shortcut, std::string, ShortcutHash> ShortcutMap;

    // structs

    struct Shortcut;
    struct ShortcutHash;

    // methods

    static std::string mouseActionToString(MouseAction action);
    static MouseAction mouseActionFromString(std::string_view action);
    static MouseButtonsMask getMouseButtonsMask(const std::string& str);
    static std::string getMouseButtonsName(MouseButtonsMask mask);
    static MouseBindings::Shortcut sanitizeShortcut(const MouseBindings::Shortcut& shortcut);
    static std::string mousebindFormat(std::string str);
    static Shortcut toShortcut(const std::string& keys);
    static std::string fromShortcut(MouseBindings::Shortcut shortcut, bool format = false);
    void addMousebindsString(const std::unordered_map<std::string, std::string>& binds);
    void addMousebinds(const ShortcutMap& binds);
    void addMousebindString(const std::string& key, const std::string& command);
    void addMousebind(const Shortcut& key, const std::string& command);
    void replaceMousebindString(const std::string& keys, const std::string& command);
    void replaceMousebind(const Shortcut& keys, const std::string& command);
    Shortcut getShortcutFromString(const std::string& keys);
    void removeMousebind(const Shortcut& keys);
    void removeMousebind(const std::string& kb);
    bool existsMousebind(const Shortcut& keys);
    bool hasCommand(const std::string& command);
    void removeCommandMousebind(const std::string& command);
    void removeCommandsMousebind(const std::vector<std::string>& command);
    std::string getCommandFromMousebind(const Shortcut& keys);
    std::string getCommandMousebindString(const std::string& command) const;
    void reset();
    const ShortcutMap& getShortcutMap() const;
    const std::unordered_map<std::string, Shortcut>& getMousebindings() const;
    Shortcut getShortcutFromCommand(const std::string& cmd) const;
    std::string getShortcutString(Shortcut shortcut, bool format = false) const;
};

Detailed Documentation

Methods

void replaceMousebindString(const std::string& keys, const std::string& command)

If the command is already on the list, it will remove the previous keybind.

void replaceMousebind(const Shortcut& keys, const std::string& command)

If the command is already on the list, it will remove the previous keybind.