diff --git a/lib/libimhex/source/api/content_registry.cpp b/lib/libimhex/source/api/content_registry.cpp index 867c2cc95..102009ac9 100644 --- a/lib/libimhex/source/api/content_registry.cpp +++ b/lib/libimhex/source/api/content_registry.cpp @@ -906,10 +906,11 @@ namespace hex { }); if (shortcut != Shortcut::None) { + auto callbackIfEnabled = [enabledCallback, function]{ if (enabledCallback()) { function(); } }; if (shortcut.isLocal() && view != nullptr) - ShortcutManager::addShortcut(view, shortcut, unlocalizedMainMenuNames.back(), function); + ShortcutManager::addShortcut(view, shortcut, unlocalizedMainMenuNames.back(), callbackIfEnabled); else - ShortcutManager::addGlobalShortcut(shortcut, unlocalizedMainMenuNames.back(), function); + ShortcutManager::addGlobalShortcut(shortcut, unlocalizedMainMenuNames.back(), callbackIfEnabled); } }