1#ifndef IMGUI_SHORTCUTS_HH
2#define IMGUI_SHORTCUTS_HH
62 [[nodiscard]]
static std::optional<Type>
parseType(std::string_view name);
73 template<
typename XmlStream>
76 xml.with_tag(
"shortcuts", [&]{
77 for (
auto [id_, shortcut_] :
enumerate(shortcuts)) {
78 auto id =
static_cast<ID>(id_);
79 const auto& shortcut = shortcut_;
81 xml.with_tag(
"shortcut", [&]{
84 if (shortcut.type ==
Type::GLOBAL) xml.attribute(
"type",
"global");
static zstring_view getShortcutName(ID id)
Shortcuts(const Shortcuts &)=delete
void setDefaultShortcuts()
Shortcuts & operator=(const Shortcuts &)=delete
@ DISASM_TOGGLE_BREAKPOINT
@ DEBUGGER_BREAK_CONTINUE
void saveShortcuts(XmlStream &xml) const
static const Shortcut & getDefaultShortcut(ID id)
static zstring_view getShortcutDescription(ID id)
bool checkShortcut(const ShortcutWithRepeat &shortcut) const
static std::optional< ID > parseShortcutName(std::string_view name)
static std::optional< Type > parseType(std::string_view name)
Shortcuts & operator=(Shortcuts &&)=delete
void setShortcut(ID id, const Shortcut &shortcut)
const Shortcut & getShortcut(ID id) const
static bool getShortcutRepeat(ID id)
Shortcuts(Shortcuts &&)=delete
Like std::string_view, but with the extra guarantee that it refers to a zero-terminated string.
constexpr auto enumerate(Iterable &&iterable)
Heavily inspired by Nathan Reed's blog post: Python-Like enumerate() In C++17 http://reedbeta....
This file implemented 3 utility functions:
std::string getKeyChordName(ImGuiKeyChord keyChord)
bool operator==(const Shortcut &other) const =default