cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajeshbatt...@apache.org
Subject [4/6] git commit: updated refs/heads/master to 62ef617
Date Thu, 23 Jan 2014 06:24:57 GMT
CLOUDSTACK-5702: Fixed mouse doesn't work for console


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

Branch: refs/heads/master
Commit: 3e2f7dda9eee384e85e7b2bc3cecc91b233b0bf2
Parents: 5941ac4
Author: Anshul Gangwar <anshul.gangwar@citrix.com>
Authored: Wed Jan 1 12:16:23 2014 +0530
Committer: Rajesh Battala <rajesh.battala@citrix.com>
Committed: Thu Jan 23 10:54:08 2014 +0530

----------------------------------------------------------------------
 .../consoleproxy/ConsoleProxyRdpClient.java     | 29 ++++++++++++++------
 1 file changed, 21 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3e2f7dda/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 73c00be..6b317ff 100644
--- a/services/console-proxy/server/src/com/cloud/consoleproxy/ConsoleProxyRdpClient.java
+++ b/services/console-proxy/server/src/com/cloud/consoleproxy/ConsoleProxyRdpClient.java
@@ -161,22 +161,23 @@ public class ConsoleProxyRdpClient extends ConsoleProxyClientBase {
         updateFrontEndActivityTime();
 
         int mousecode = mapMouseButton(code);
-        int modifier = mapMouseModifier(code, modifiers);
 
-        /*if (event == InputEventType.MOUSE_DOWN) {
-            _mouseEventSource.mousePressed(new MouseEvent(_canvas, MouseEvent.MOUSE_PRESSED,
System.currentTimeMillis(), modifier, x, y, 1, false, mousecode));
+        if (event == InputEventType.MOUSE_DOWN) {
+            _mouseEventSource.mousePressed(new MouseEvent(_canvas, MouseEvent.MOUSE_PRESSED,
System.currentTimeMillis(), mapMouseDownModifier(code, modifiers), x, y, 1, false,
+                    mousecode));
         }
 
         if (event == InputEventType.MOUSE_UP) {
-            _mouseEventSource.mouseReleased((new MouseEvent(_canvas, MouseEvent.MOUSE_RELEASED,
System.currentTimeMillis(), modifier, x, y, 1, false, mousecode)));
+            _mouseEventSource.mouseReleased((new MouseEvent(_canvas, MouseEvent.MOUSE_RELEASED,
System.currentTimeMillis(), mapMouseUpModifier(code, modifiers), x, y, 1, false,
+                    mousecode)));
         }
 
-        if (event == InputEventType.MOUSE_DBLCLICK) {
-            _mouseEventSource.mouseReleased((new MouseEvent(_canvas, MouseEvent.MOUSE_RELEASED,
System.currentTimeMillis(), modifier, x, y, 2, false, mousecode)));
-        }*/
+        if (event == InputEventType.MOUSE_MOVE) {
+            _mouseEventSource.mouseMoved(new MouseEvent(_canvas, MouseEvent.MOUSE_MOVED,
System.currentTimeMillis(), mapModifier(modifiers), x, y, 0, false));
+        }
     }
 
-    public int mapMouseModifier(int code, int modifiers) {
+    public int mapMouseDownModifier(int code, int modifiers) {
         int mod = mapModifier(modifiers);
         switch (code) {
         case 0:
@@ -188,6 +189,18 @@ public class ConsoleProxyRdpClient extends ConsoleProxyClientBase {
         return mod;
     }
 
+    public int mapMouseUpModifier(int code, int modifiers) {
+        int mod = mapModifier(modifiers);
+        switch (code) {
+        case 0:
+            return mod = mod | MouseEvent.BUTTON1_MASK;
+        case 2:
+            return mod = mod | MouseEvent.BUTTON3_MASK;
+        default:
+        }
+        return mod;
+    }
+
     private int mapModifier(int modifiers) {
         int mod = 0;
         if ((modifiers & SHIFT_KEY_MASK) != (_lastModifierStates & SHIFT_KEY_MASK))
{


Mime
View raw message