cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajeshbatt...@apache.org
Subject [5/6] git commit: updated refs/heads/master to 62ef617
Date Thu, 23 Jan 2014 06:24:58 GMT
CLOUDSTACK-5716: fixed can't type special character in console view


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/6ebbec23
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/6ebbec23
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/6ebbec23

Branch: refs/heads/master
Commit: 6ebbec239d15f64d07d6e9cc90e6bbdd43046c78
Parents: 513f1db
Author: Anshul Gangwar <anshul.gangwar@citrix.com>
Authored: Fri Jan 3 17:03:36 2014 +0530
Committer: Rajesh Battala <rajesh.battala@citrix.com>
Committed: Thu Jan 23 10:54:09 2014 +0530

----------------------------------------------------------------------
 .../adapter/AwtRdpKeyboardAdapter.java          |  2 +-
 .../consoleproxy/ConsoleProxyRdpClient.java     | 29 +++++++-------------
 .../cloud/consoleproxy/rdp/KeysymToKeycode.java | 27 ++++++++++++++++--
 3 files changed, 36 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6ebbec23/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/adapter/AwtRdpKeyboardAdapter.java
----------------------------------------------------------------------
diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/adapter/AwtRdpKeyboardAdapter.java
b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/adapter/AwtRdpKeyboardAdapter.java
index f2b19e1..2d1e8fc 100755
--- a/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/adapter/AwtRdpKeyboardAdapter.java
+++ b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/adapter/AwtRdpKeyboardAdapter.java
@@ -343,7 +343,7 @@ public class AwtRdpKeyboardAdapter extends BaseElement {
 
         default:
             System.err.println("Key is not mapped: " + event + ".");
-            return 57; // Space
+            return event.getKeyCode();
         }
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6ebbec23/services/console-proxy/server/src/com/cloud/consoleproxy/ConsoleProxyRdpClient.java
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/src/com/cloud/consoleproxy/ConsoleProxyRdpClient.java
b/services/console-proxy/server/src/com/cloud/consoleproxy/ConsoleProxyRdpClient.java
index 6b317ff..d5a3fcd 100644
--- a/services/console-proxy/server/src/com/cloud/consoleproxy/ConsoleProxyRdpClient.java
+++ b/services/console-proxy/server/src/com/cloud/consoleproxy/ConsoleProxyRdpClient.java
@@ -57,8 +57,6 @@ public class ConsoleProxyRdpClient extends ConsoleProxyClientBase {
     private Thread _worker;
     private volatile boolean _workerDone = false;
 
-    private int _lastModifierStates = 0;
-
     private AwtMouseEventSource _mouseEventSource = null;
     private AwtKeyEventSource _keyEventSource = null;
 
@@ -203,26 +201,19 @@ public class ConsoleProxyRdpClient extends ConsoleProxyClientBase {
 
     private int mapModifier(int modifiers) {
         int mod = 0;
-        if ((modifiers & SHIFT_KEY_MASK) != (_lastModifierStates & SHIFT_KEY_MASK))
{
-            if ((modifiers & SHIFT_KEY_MASK) != 0)
-                mod = mod | InputEvent.SHIFT_DOWN_MASK;
-        }
 
-        if ((modifiers & CTRL_KEY_MASK) != (_lastModifierStates & CTRL_KEY_MASK))
{
-            if ((modifiers & CTRL_KEY_MASK) != 0)
-                mod = mod | InputEvent.CTRL_DOWN_MASK;
-        }
+        if ((modifiers & SHIFT_KEY_MASK) != 0)
+            mod = mod | InputEvent.SHIFT_DOWN_MASK;
 
-        if ((modifiers & META_KEY_MASK) != (_lastModifierStates & META_KEY_MASK))
{
-            if ((modifiers & META_KEY_MASK) != 0)
-                mod = mod | InputEvent.META_DOWN_MASK;
-        }
+        if ((modifiers & CTRL_KEY_MASK) != 0)
+            mod = mod | InputEvent.CTRL_DOWN_MASK;
+
+        if ((modifiers & META_KEY_MASK) != 0)
+            mod = mod | InputEvent.META_DOWN_MASK;
+
+        if ((modifiers & ALT_KEY_MASK) != 0)
+            mod = mod | InputEvent.ALT_DOWN_MASK;
 
-        if ((modifiers & ALT_KEY_MASK) != (_lastModifierStates & ALT_KEY_MASK)) {
-            if ((modifiers & ALT_KEY_MASK) != 0)
-                mod = mod | InputEvent.ALT_DOWN_MASK;
-        }
-        _lastModifierStates = mod;
         return mod;
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6ebbec23/services/console-proxy/server/src/com/cloud/consoleproxy/rdp/KeysymToKeycode.java
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/src/com/cloud/consoleproxy/rdp/KeysymToKeycode.java
b/services/console-proxy/server/src/com/cloud/consoleproxy/rdp/KeysymToKeycode.java
index 10282ad..f13dfe6 100644
--- a/services/console-proxy/server/src/com/cloud/consoleproxy/rdp/KeysymToKeycode.java
+++ b/services/console-proxy/server/src/com/cloud/consoleproxy/rdp/KeysymToKeycode.java
@@ -20,7 +20,7 @@ import java.awt.event.KeyEvent;
 
 public class KeysymToKeycode {
 
-    // this keymap is taken from http://openwonderland.googlecode.com/svn/trunk/modules/foundation/xremwin/src/classes/org/jdesktop/wonderland/modules/xremwin/client/KeycodeToKeysym.java
+    // some of this keymap is taken from http://openwonderland.googlecode.com/svn/trunk/modules/foundation/xremwin/src/classes/org/jdesktop/wonderland/modules/xremwin/client/KeycodeToKeysym.java
     private final static int[][] map = {
             /* XK_BackSpace         */{0xFF08, KeyEvent.VK_BACK_SPACE},
             /* XK_Tab               */{0xFF09, KeyEvent.VK_TAB},
@@ -101,10 +101,33 @@ public class KeysymToKeycode {
             /* XK_x                 */{0x0078, KeyEvent.VK_X},
             /* XK_y                 */{0x0079, KeyEvent.VK_Y},
             /* XK_z                 */{0x007a, KeyEvent.VK_Z},
+            {0x0060, KeyEvent.VK_BACK_QUOTE},
+            {0x007e, KeyEvent.VK_BACK_QUOTE},
+            {0x0021, KeyEvent.VK_1},
+            {0x0040, KeyEvent.VK_2},
+            {0x0023, KeyEvent.VK_3},
+            {0x0024, KeyEvent.VK_4},
+            {0x0025, KeyEvent.VK_5},
+            {0x005e, KeyEvent.VK_6},
+            {0x0026, KeyEvent.VK_7},
+            {0x002A, KeyEvent.VK_8},
+            {0x0028, KeyEvent.VK_9},
+            {0x0029, KeyEvent.VK_0},
+            {0x005f, KeyEvent.VK_MINUS},
+            {0x002b, KeyEvent.VK_EQUALS},
+            {0x007b, KeyEvent.VK_OPEN_BRACKET},
+            {0x007d, KeyEvent.VK_CLOSE_BRACKET},
+            {0x007c, KeyEvent.VK_BACK_SLASH},
+            {0x003a, KeyEvent.VK_SEMICOLON},
+            {0x0027, KeyEvent.VK_QUOTE},
+            {0x0022, KeyEvent.VK_QUOTE},
+            {0x003c, KeyEvent.VK_COMMA},
+            {0x003e, KeyEvent.VK_PERIOD},
+            {0x003f, KeyEvent.VK_SLASH},
     };
 
     public static int getKeycode(int keysym) {
-        for (int i = 0; i < (map.length - 1); i++) {
+        for (int i = 0; i < (map.length); i++) {
             if (map[i][0] == keysym) {
                 return map[i][1];
             }


Mime
View raw message