mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 05:27:41 -05:00
impr: Add option to ShortcutManager to get a shortcut by its name
This commit is contained in:
@@ -387,6 +387,24 @@ namespace hex {
|
||||
s_globalShortcuts->clear();
|
||||
}
|
||||
|
||||
Shortcut ShortcutManager::getShortcutByName(const std::vector<UnlocalizedString> &unlocalizedName, const View *view) {
|
||||
if (view != nullptr) {
|
||||
for (const auto &[shortcut, entry] : view->m_shortcuts) {
|
||||
if (entry.unlocalizedName == unlocalizedName) {
|
||||
return entry.shortcut;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (const auto &[shortcut, entry] : *s_globalShortcuts) {
|
||||
if (entry.unlocalizedName == unlocalizedName) {
|
||||
return entry.shortcut;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return Shortcut::None;
|
||||
}
|
||||
|
||||
void ShortcutManager::resumeShortcuts() {
|
||||
s_paused = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user