1
0
mirror of synced 2024-11-30 10:24:30 +01:00
ImHex/plugins/builtin/source/content/shortcuts.cpp

20 lines
556 B
C++
Raw Normal View History

#include <hex/api/keybinding.hpp>
#include <hex/api/event.hpp>
namespace hex::plugin::builtin {
void registerShortcuts() {
// Open file
ShortcutManager::addGlobalShortcut(CTRL + Keys::O, [] {
fs::openFileBrowser(fs::DialogMode::Open, {}, [](const auto &path) {
EventManager::post<RequestOpenFile>(path);
});
});
// Close file
ShortcutManager::addGlobalShortcut(CTRL + Keys::W, [] {
ImHexApi::Provider::remove(ImHexApi::Provider::get());
});
}
}