1
0
mirror of synced 2024-11-27 00:50:51 +01:00
ImHex/plugins/builtin/source/content/shortcuts.cpp
2022-07-30 22:01:49 +02:00

20 lines
556 B
C++

#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());
});
}
}