flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [2/6] git commit: [flex-asjs] [refs/heads/tlf] - handle Safari 9 keyboard events
Date Tue, 09 May 2017 18:00:00 GMT
handle Safari 9 keyboard events


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/fa712221
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/fa712221
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/fa712221

Branch: refs/heads/tlf
Commit: fa7122215cb570255bc346ea3a350b8dbf628fa7
Parents: ccfe255
Author: Alex Harui <aharui@apache.org>
Authored: Tue May 9 08:09:39 2017 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Tue May 9 08:14:03 2017 -0700

----------------------------------------------------------------------
 .../main/flex/org/apache/flex/events/utils/KeyConverter.as   | 1 -
 .../org/apache/flex/events/utils/KeyboardEventConverter.as   | 8 +++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fa712221/frameworks/projects/Core/src/main/flex/org/apache/flex/events/utils/KeyConverter.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/events/utils/KeyConverter.as
b/frameworks/projects/Core/src/main/flex/org/apache/flex/events/utils/KeyConverter.as
index 95056c2..113e161 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/events/utils/KeyConverter.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/events/utils/KeyConverter.as
@@ -78,7 +78,6 @@ package org.apache.flex.events.utils
          *  @playerversion AIR 2.6
          *  @productversion FlexJS 0.8
          */
-         COMPILE::SWF
          public static function convertKeyCode(code:uint):String
          {
              // A to Z

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fa712221/frameworks/projects/Core/src/main/flex/org/apache/flex/events/utils/KeyboardEventConverter.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/events/utils/KeyboardEventConverter.as
b/frameworks/projects/Core/src/main/flex/org/apache/flex/events/utils/KeyboardEventConverter.as
index 83b9ff9..fc8a630 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/events/utils/KeyboardEventConverter.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/events/utils/KeyboardEventConverter.as
@@ -71,7 +71,13 @@ package org.apache.flex.events.utils
 		public static function convert(oldEvent:KeyboardEvent):org.apache.flex.events.KeyboardEvent
 		{
 			var type:String = oldEvent.type == "keydown" ? "key_down" : "key_up"; 
-			var newEvent:org.apache.flex.events.KeyboardEvent = new org.apache.flex.events.KeyboardEvent(type,
oldEvent.key, oldEvent.code);
+			var key:String = oldEvent.key;
+			if (key == null)
+				key = KeyConverter.convertCharCode(oldEvent['charCode']);
+			var code:String = oldEvent.code;
+			if (code == null)
+				code = KeyConverter.convertKeyCode(oldEvent['keyCode']);
+			var newEvent:org.apache.flex.events.KeyboardEvent = new org.apache.flex.events.KeyboardEvent(type,
key, code);
 			newEvent.altKey = oldEvent.altKey;
 			newEvent.ctrlKey = oldEvent.ctrlKey;
 			newEvent.metaKey = oldEvent.metaKey;


Mime
View raw message