diff options
Diffstat (limited to 'include/cru/ui/helper')
-rw-r--r-- | include/cru/ui/helper/ShortcutHub.hpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/include/cru/ui/helper/ShortcutHub.hpp b/include/cru/ui/helper/ShortcutHub.hpp index a4ff2da2..fe3414fe 100644 --- a/include/cru/ui/helper/ShortcutHub.hpp +++ b/include/cru/ui/helper/ShortcutHub.hpp @@ -19,8 +19,9 @@ namespace cru::ui::helper { class ShortcutKeyBind { public: - ShortcutKeyBind(platform::gui::KeyCode key, - platform::gui::KeyModifier modifier) + ShortcutKeyBind( + platform::gui::KeyCode key, + platform::gui::KeyModifier modifier = platform::gui::KeyModifiers::none) : key_(key), modifier_(modifier) {} CRU_DEFAULT_COPY(ShortcutKeyBind) @@ -111,6 +112,8 @@ class ShortcutHub : public Object { const std::vector<ShortcutInfo>& GetShortcutByKeyBind( const ShortcutKeyBind& key_bind) const; + IEvent<event::KeyEventArgs&>* FallbackKeyEvent() { return &fallback_event_; } + void Install(controls::Control* control); void Uninstall(); @@ -124,6 +127,8 @@ class ShortcutHub : public Object { int current_id_ = 1; + Event<event::KeyEventArgs&> fallback_event_; + EventRevokerListGuard event_guard_; }; } // namespace cru::ui::helper |