royale-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ha...@apache.org
Subject [royale-asjs] branch develop updated: Added missing Keyboard values
Date Wed, 08 Nov 2017 22:24:08 GMT
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 3ca9108  Added missing Keyboard values
3ca9108 is described below

commit 3ca9108d03528e63de1ccf004f965eb62c8e1b18
Author: Harbs <harbs@in-tools.com>
AuthorDate: Thu Nov 9 00:24:01 2017 +0200

    Added missing Keyboard values
---
 .../src/main/royale/org/apache/royale/events/utils/KeyConverter.as | 7 +++++++
 .../org/apache/royale/events/utils/KeyboardEventConverter.as       | 6 ++++++
 2 files changed, 13 insertions(+)

diff --git a/frameworks/projects/Core/src/main/royale/org/apache/royale/events/utils/KeyConverter.as
b/frameworks/projects/Core/src/main/royale/org/apache/royale/events/utils/KeyConverter.as
index 6169a65..b2321c1 100644
--- a/frameworks/projects/Core/src/main/royale/org/apache/royale/events/utils/KeyConverter.as
+++ b/frameworks/projects/Core/src/main/royale/org/apache/royale/events/utils/KeyConverter.as
@@ -112,6 +112,8 @@ package org.apache.royale.events.utils
                     return "ShiftLeft";
                 case 17:
                     return "ControlLeft";
+                case 18:
+                    return "AltLeft";
                 case 20:
                     return "CapsLock";
                 case 27:
@@ -138,6 +140,11 @@ package org.apache.royale.events.utils
                     return "Insert";
                 case 46:
                     return "Delete";
+                case 91:
+                    return "MetaLeft";
+                case 92:
+                case 93://both 92 and 93 can be MetaRight depending on the platform
+                    return "MetaRight";
                 case 144:
                     return "NumLock";
                 case 145:
diff --git a/frameworks/projects/Core/src/main/royale/org/apache/royale/events/utils/KeyboardEventConverter.as
b/frameworks/projects/Core/src/main/royale/org/apache/royale/events/utils/KeyboardEventConverter.as
index f029bcc..9acc05f 100644
--- a/frameworks/projects/Core/src/main/royale/org/apache/royale/events/utils/KeyboardEventConverter.as
+++ b/frameworks/projects/Core/src/main/royale/org/apache/royale/events/utils/KeyboardEventConverter.as
@@ -72,11 +72,17 @@ package org.apache.royale.events.utils
 		{
 			var type:String = nativeEvent["type"];
 			var key:String = nativeEvent["key"];
+			//Safari has to be different...
+			if(key == null)
+				key = nativeEvent["keyIdentifier"];
+			
 			if (key == null)
 				key = KeyConverter.convertCharCode(nativeEvent['charCode']);
+			
 			var code:String = nativeEvent["code"];
 			if (code == null)
 				code = KeyConverter.convertKeyCode(nativeEvent['keyCode']);
+			
 			var newEvent:KeyboardEvent = new KeyboardEvent(type, key, code, nativeEvent["shiftKey"]);
 			newEvent.altKey = nativeEvent["altKey"];
 			newEvent.ctrlKey = nativeEvent["ctrlKey"];

-- 
To stop receiving notification emails like this one, please contact
['"commits@royale.apache.org" <commits@royale.apache.org>'].

Mime
View raw message