* Composer key forwarding fix 4.x-dev

Wed, 21 Oct 2020 09:29:25 +0300

author
cemkalyoncu
date
Wed, 21 Oct 2020 09:29:25 +0300
branch
4.x-dev
changeset 1469
5c0962155ba0
parent 1468
e92d177503af
child 1470
762bf25977fb

* Composer key forwarding fix

Source/Gorgon/Widgets/Composer.cpp file | annotate | diff | comparison | revisions
Source/Gorgon/Widgets/Composer.h file | annotate | diff | comparison | revisions
Source/Gorgon/Widgets/Panel.cpp file | annotate | diff | comparison | revisions
--- a/Source/Gorgon/Widgets/Composer.cpp	Mon Oct 19 21:20:35 2020 +0300
+++ b/Source/Gorgon/Widgets/Composer.cpp	Wed Oct 21 09:29:25 2020 +0300
@@ -13,6 +13,9 @@
     }
     
     bool Composer::allowfocus() const {
+        if(CurrentFocusStrategy() == Deny)
+            return false;
+
         for(auto &w : widgets) {
             if(w.AllowFocus()) {
                 return true;
--- a/Source/Gorgon/Widgets/Composer.h	Mon Oct 19 21:20:35 2020 +0300
+++ b/Source/Gorgon/Widgets/Composer.h	Wed Oct 21 09:29:25 2020 +0300
@@ -77,7 +77,14 @@
         virtual bool IsEnabled() const override {
             return enabled;
         }
-        
+
+        /// This function should be called whenever a key is pressed or released.
+        virtual bool KeyEvent(Input::Key key, float state) override { return distributekeyevent(key, state, true); }
+
+        /// This function should be called whenever a character is received from
+        /// operating system.
+        virtual bool CharacterEvent(Char c) override { return distributecharevent(c); }
+
     protected:
         //ensure this object is derived
         Composer() {
--- a/Source/Gorgon/Widgets/Panel.cpp	Mon Oct 19 21:20:35 2020 +0300
+++ b/Source/Gorgon/Widgets/Panel.cpp	Wed Oct 21 09:29:25 2020 +0300
@@ -162,6 +162,8 @@
     }
     
     bool Panel::allowfocus() const {
+        if(CurrentFocusStrategy() == Deny)
+            return false;
         for(auto &w : widgets) {
             if(w.AllowFocus()) {
                 return true;

mercurial