2022-07-30 22:01:49 +02:00
|
|
|
#include <hex/api/keybinding.hpp>
|
|
|
|
#include <hex/api/event.hpp>
|
|
|
|
|
|
|
|
namespace hex::plugin::builtin {
|
|
|
|
|
|
|
|
void registerShortcuts() {
|
2022-08-28 20:55:48 +02:00
|
|
|
// New file
|
|
|
|
ShortcutManager::addGlobalShortcut(CTRL + Keys::N, [] {
|
|
|
|
EventManager::post<RequestOpenWindow>("Create File");
|
|
|
|
});
|
|
|
|
|
2022-07-30 22:01:49 +02:00
|
|
|
// Open file
|
|
|
|
ShortcutManager::addGlobalShortcut(CTRL + Keys::O, [] {
|
2022-08-28 20:55:48 +02:00
|
|
|
EventManager::post<RequestOpenWindow>("Open File");
|
2022-07-30 22:01:49 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
// Close file
|
|
|
|
ShortcutManager::addGlobalShortcut(CTRL + Keys::W, [] {
|
|
|
|
ImHexApi::Provider::remove(ImHexApi::Provider::get());
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|