Use “specialKey” for platform independent control/command

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

Branch: refs/heads/develop
Commit: 18d26d585bc3a5b5ee59415eb7c5cdd3f3c28573
Parents: b922b6b
Author: Harbs <[email protected]>
Authored: Wed Jun 21 13:32:37 2017 +0300
Committer: Harbs <[email protected]>
Committed: Wed Jun 21 13:32:37 2017 +0300

----------------------------------------------------------------------
 .../apache/flex/textLayout/edit/EditManager.as  |  2 +-
 .../flex/textLayout/edit/SelectionManager.as    | 28 ++++++++++----------
 .../events/FlowElementMouseEventManager.as      |  2 +-
 3 files changed, 16 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/18d26d58/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/edit/EditManager.as
----------------------------------------------------------------------
diff --git 
a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/edit/EditManager.as
 
b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/edit/EditManager.as
index 99dfcee..a0d7bde 100644
--- 
a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/edit/EditManager.as
+++ 
b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/edit/EditManager.as
@@ -282,7 +282,7 @@ package org.apache.flex.textLayout.edit
                        
                        super.keyDownHandler(event);
                        
-                       if (event.ctrlKey)
+                       if (event.specialKey)
                        {
                                // The player subsequently sends a text input 
event (which should be ignored) as listed below:
                                // CTRL/CMD+z: Only on Mac when using a 
pre-Argo player version

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/18d26d58/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/edit/SelectionManager.as
----------------------------------------------------------------------
diff --git 
a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/edit/SelectionManager.as
 
b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/edit/SelectionManager.as
index 04c4255..1860ac3 100644
--- 
a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/edit/SelectionManager.as
+++ 
b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/edit/SelectionManager.as
@@ -2415,14 +2415,14 @@ package org.apache.flex.textLayout.edit
                        {
                                if (_textFlow.computedFormat.direction == 
Direction.LTR)
                                {
-                                       if (event.ctrlKey || event.altKey)
+                                       if (event.specialKey || event.altKey)
                                                
NavigationUtil.previousWord(selState, event.shiftKey);
                                        else
                                                
NavigationUtil.previousCharacter(selState, event.shiftKey);
                                }
                                else
                                {
-                                       if (event.ctrlKey || event.altKey)
+                                       if (event.specialKey || event.altKey)
                                                
NavigationUtil.nextWord(selState, event.shiftKey);
                                        else
                                                
NavigationUtil.nextCharacter(selState, event.shiftKey);
@@ -2433,7 +2433,7 @@ package org.apache.flex.textLayout.edit
                                // always test for altkey first - that way 
ctrl-alt is the same as alt
                                if (event.altKey)
                                        NavigationUtil.endOfParagraph(selState, 
event.shiftKey);
-                               else if (event.ctrlKey)
+                               else if (event.specialKey)
                                        NavigationUtil.endOfDocument(selState, 
event.shiftKey);
                                else
                                        NavigationUtil.nextLine(selState, 
event.shiftKey);
@@ -2449,7 +2449,7 @@ package org.apache.flex.textLayout.edit
                                // always test for altkey first - that way 
ctrl-alt is the same as alt
                                if (event.altKey)
                                        
NavigationUtil.startOfParagraph(selState, event.shiftKey);
-                               else if (event.ctrlKey)
+                               else if (event.specialKey)
                                        
NavigationUtil.startOfDocument(selState, event.shiftKey);
                                else
                                        NavigationUtil.previousLine(selState, 
event.shiftKey);
@@ -2458,14 +2458,14 @@ package org.apache.flex.textLayout.edit
                        {
                                if (_textFlow.computedFormat.direction == 
Direction.LTR)
                                {
-                                       if (event.ctrlKey || event.altKey)
+                                       if (event.specialKey || event.altKey)
                                                
NavigationUtil.previousWord(selState, event.shiftKey);
                                        else
                                                
NavigationUtil.previousCharacter(selState, event.shiftKey);
                                }
                                else
                                {
-                                       if (event.ctrlKey || event.altKey)
+                                       if (event.specialKey || event.altKey)
                                                
NavigationUtil.nextWord(selState, event.shiftKey);
                                        else
                                                
NavigationUtil.nextCharacter(selState, event.shiftKey);
@@ -2482,14 +2482,14 @@ package org.apache.flex.textLayout.edit
                        {
                                if (_textFlow.computedFormat.direction == 
Direction.LTR)
                                {
-                                       if (event.ctrlKey || event.altKey)
+                                       if (event.specialKey || event.altKey)
                                                
NavigationUtil.nextWord(selState, event.shiftKey);
                                        else
                                                
NavigationUtil.nextCharacter(selState, event.shiftKey);
                                }
                                else
                                {
-                                       if (event.ctrlKey || event.altKey)
+                                       if (event.specialKey || event.altKey)
                                                
NavigationUtil.previousWord(selState, event.shiftKey);
                                        else
                                                
NavigationUtil.previousCharacter(selState, event.shiftKey);
@@ -2500,7 +2500,7 @@ package org.apache.flex.textLayout.edit
                                // always test for altkey first - that way 
ctrl-alt is the same as alt
                                if (event.altKey)
                                        
NavigationUtil.startOfParagraph(selState, event.shiftKey);
-                               else if (event.ctrlKey)
+                               else if (event.specialKey)
                                        
NavigationUtil.startOfDocument(selState, event.shiftKey);
                                else
                                        NavigationUtil.previousLine(selState, 
event.shiftKey);
@@ -2517,7 +2517,7 @@ package org.apache.flex.textLayout.edit
                                // always test for altkey first - that way 
ctrl-alt is the same as alt
                                if (event.altKey)
                                        NavigationUtil.endOfParagraph(selState, 
event.shiftKey);
-                               else if (event.ctrlKey)
+                               else if (event.specialKey)
                                        NavigationUtil.endOfDocument(selState, 
event.shiftKey);
                                else
                                        NavigationUtil.nextLine(selState, 
event.shiftKey);
@@ -2526,14 +2526,14 @@ package org.apache.flex.textLayout.edit
                        {
                                if (_textFlow.computedFormat.direction == 
Direction.LTR)
                                {
-                                       if (event.ctrlKey || event.altKey)
+                                       if (event.specialKey || event.altKey)
                                                
NavigationUtil.nextWord(selState, event.shiftKey);
                                        else
                                                
NavigationUtil.nextCharacter(selState, event.shiftKey);
                                }
                                else
                                {
-                                       if (event.ctrlKey || event.altKey)
+                                       if (event.specialKey || event.altKey)
                                                
NavigationUtil.previousWord(selState, event.shiftKey);
                                        else
                                                
NavigationUtil.previousCharacter(selState, event.shiftKey);
@@ -2546,7 +2546,7 @@ package org.apache.flex.textLayout.edit
                private function 
handleHomeKey(event:KeyboardEvent):SelectionState
                {
                        var selState:SelectionState = getSelectionState();
-                       if (event.ctrlKey && !event.altKey)
+                       if (event.specialKey && !event.altKey)
                                NavigationUtil.startOfDocument(selState, 
event.shiftKey);
                        else
                                NavigationUtil.startOfLine(selState, 
event.shiftKey);
@@ -2556,7 +2556,7 @@ package org.apache.flex.textLayout.edit
                private function 
handleEndKey(event:KeyboardEvent):SelectionState
                {
                        var selState:SelectionState = getSelectionState();
-                       if (event.ctrlKey && !event.altKey)
+                       if (event.specialKey && !event.altKey)
                                NavigationUtil.endOfDocument(selState, 
event.shiftKey);
                        else
                                NavigationUtil.endOfLine(selState, 
event.shiftKey);

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/18d26d58/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/FlowElementMouseEventManager.as
----------------------------------------------------------------------
diff --git 
a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/FlowElementMouseEventManager.as
 
b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/FlowElementMouseEventManager.as
index 02a0e7c..94cdcbd 100644
--- 
a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/FlowElementMouseEventManager.as
+++ 
b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/FlowElementMouseEventManager.as
@@ -501,7 +501,7 @@ package org.apache.flex.textLayout.events
                private function hitTestKeyEventHandler(evt:KeyboardEvent):void
                {
                        if (!_blockInteraction)
-                               checkCtrlKeyState(evt.ctrlKey);
+                               checkCtrlKeyState(evt.specialKey);
                }
                
                /**

Reply via email to