sys: Fixed global shortcuts not working correctly

Fixes #606
This commit is contained in:
WerWolv
2022-07-30 22:01:49 +02:00
parent a097f162a7
commit 3d5568f65f
14 changed files with 63 additions and 30 deletions

View File

@@ -102,7 +102,6 @@ namespace hex {
/* Default Events */
EVENT_DEF(EventFileLoaded, std::fs::path);
EVENT_DEF(EventFileUnloaded);
EVENT_DEF(EventDataChanged);
EVENT_DEF(EventHighlightingChanged);
EVENT_DEF(EventWindowClosing, GLFWwindow *);
@@ -114,6 +113,7 @@ namespace hex {
EVENT_DEF(EventOSThemeChanged);
EVENT_DEF(EventProviderCreated, prv::Provider *);
EVENT_DEF(EventProviderChanged, prv::Provider *, prv::Provider *);
EVENT_DEF(EventProviderDeleted, prv::Provider *);
EVENT_DEF(EventFrameBegin);
EVENT_DEF(EventFrameEnd);
EVENT_DEF(EventWindowInitialized);

View File

@@ -188,7 +188,9 @@ namespace hex {
public:
static void addGlobalShortcut(const Shortcut &shortcut, const std::function<void()> &callback);
static void addShortcut(View *view, const Shortcut &shortcut, const std::function<void()> &callback);
static void process(View *currentView, bool ctrl, bool alt, bool shift, bool super, bool focused, u32 keyCode);
static void processGlobals(bool ctrl, bool alt, bool shift, bool super, u32 keyCode);
static void clearShortcuts();