Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6519010D72 for ; Thu, 23 Jan 2014 06:25:05 +0000 (UTC) Received: (qmail 20845 invoked by uid 500); 23 Jan 2014 06:25:03 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 20620 invoked by uid 500); 23 Jan 2014 06:25:02 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 20147 invoked by uid 99); 23 Jan 2014 06:24:56 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Jan 2014 06:24:55 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 0FFCB8AC45A; Thu, 23 Jan 2014 06:24:55 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: rajeshbattala@apache.org To: commits@cloudstack.apache.org Date: Thu, 23 Jan 2014 06:24:57 -0000 Message-Id: <144a243dbec74a8a94d0b8c7fdffa1b1@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [4/6] git commit: updated refs/heads/master to 62ef617 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 Authored: Wed Jan 1 12:16:23 2014 +0530 Committer: Rajesh Battala 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)) {