103 std::vector<ImGuiKey> shortcuts;
107 size_t end = shortcut.find(kCtrlKey);
108 if (end != std::string::npos) {
109 shortcuts.push_back(ImGuiMod_Ctrl);
110 start = end + kCtrlKey.size();
113 end = shortcut.find(kAltKey, start);
114 if (end != std::string::npos) {
115 shortcuts.push_back(ImGuiMod_Alt);
116 start = end + kAltKey.size();
119 end = shortcut.find(kShiftKey, start);
120 if (end != std::string::npos) {
121 shortcuts.push_back(ImGuiMod_Shift);
122 start = end + kShiftKey.size();
125 end = shortcut.find(kSuperKey, start);
126 if (end != std::string::npos) {
127 shortcuts.push_back(ImGuiMod_Super);
128 start = end + kSuperKey.size();
132 while (start < shortcut.size()) {
142 for (
const auto& shortcut : shortcut_manager.
GetShortcuts()) {
143 bool keys_pressed =
true;
145 for (
const auto& key : shortcut.second.keys) {
146 if (key == ImGuiMod_Ctrl) {
147 keys_pressed &= ImGui::GetIO().KeyCtrl;
148 }
else if (key == ImGuiMod_Alt) {
149 keys_pressed &= ImGui::GetIO().KeyAlt;
150 }
else if (key == ImGuiMod_Shift) {
151 keys_pressed &= ImGui::GetIO().KeyShift;
152 }
else if (key == ImGuiMod_Super) {
153 keys_pressed &= ImGui::GetIO().KeySuper;
155 keys_pressed &= ImGui::IsKeyDown(key);
162 shortcut.second.callback();