This is an automated email from the ASF dual-hosted git repository.

harbs pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new 3c6cbb7  Fixes #392
3c6cbb7 is described below

commit 3c6cbb78cfa43dfa1a569cb9c7dec289d7e58e93
Author: Harbs <[email protected]>
AuthorDate: Wed Feb 6 10:07:02 2019 +0200

    Fixes #392
---
 .../src/main/royale/mx/events/KeyboardEvent.as     | 33 ++++++++++++++--------
 1 file changed, 22 insertions(+), 11 deletions(-)

diff --git 
a/frameworks/projects/MXRoyale/src/main/royale/mx/events/KeyboardEvent.as 
b/frameworks/projects/MXRoyale/src/main/royale/mx/events/KeyboardEvent.as
index 6284848..8f9f58e 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/events/KeyboardEvent.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/events/KeyboardEvent.as
@@ -23,6 +23,10 @@ COMPILE::SWF
 {
 import flash.events.KeyboardEvent;  
 }
+COMPILE::JS
+{
+       import goog.events.BrowserEvent;
+}
 /* import mx.events.Event;*/
 import org.apache.royale.events.Event;
 import org.apache.royale.events.IRoyaleEvent;
@@ -114,18 +118,25 @@ public class KeyboardEvent extends 
org.apache.royale.events.KeyboardEvent
                } 
                
                
-                private static function platformConstant(s:uint):uint
-               {
-               return s;
-                       }
-                private static function platformConstant1(s:String):String
-               {
-               return s;
-               }
+               private static function platformConstant(s:uint):uint
+               {
+                               return s;
+               }
+               private static function platformConstant1(s:String):String
+               {
+                               return s;
+               }
+               private static var _capsLock:Boolean;
                public static function get capsLock():Boolean
-               {
-               return true;
-               }
+               {
+                       return _capsLock;
+               }
+               override public function 
wrapEvent(event:goog.events.BrowserEvent):void
+               {
+                       super.wrapEvent(event);
+                       _capsLock = nativeEvent["getModifierState"]("CapsLock");
+               }
+
        
//--------------------------------------------------------------------------
        //
        //  Class constants

Reply via email to