aboutsummaryrefslogtreecommitdiff
path: root/include/cru/ui/helper
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-12-26 19:39:24 +0800
committercrupest <crupest@outlook.com>2020-12-26 19:39:24 +0800
commit715be3c81b96fcf87c7650501d71480a8743a984 (patch)
treef56119db325f57280ab625cf1927b846e3eebdcb /include/cru/ui/helper
parent61b835d47ab98279c5f2f43bebcd4fe18f7c408d (diff)
downloadcru-715be3c81b96fcf87c7650501d71480a8743a984.tar.gz
cru-715be3c81b96fcf87c7650501d71480a8743a984.tar.bz2
cru-715be3c81b96fcf87c7650501d71480a8743a984.zip
...
Diffstat (limited to 'include/cru/ui/helper')
-rw-r--r--include/cru/ui/helper/ShortcutHub.hpp9
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