diff --git a/Client/Core/Commands/SurveillanceHandler.cs b/Client/Core/Commands/SurveillanceHandler.cs index b11ce2cf..1b0169b4 100644 --- a/Client/Core/Commands/SurveillanceHandler.cs +++ b/Client/Core/Commands/SurveillanceHandler.cs @@ -81,20 +81,20 @@ namespace xClient.Core.Commands { case MouseAction.LeftDown: case MouseAction.LeftUp: - NativeMethodsHelper.DoMouseEventLeft(p, command.IsMouseDown); + NativeMethodsHelper.DoMouseLeftClick(p, command.IsMouseDown); break; case MouseAction.RightDown: case MouseAction.RightUp: - NativeMethodsHelper.DoMouseEventRight(p, command.IsMouseDown); + NativeMethodsHelper.DoMouseRightClick(p, command.IsMouseDown); break; case MouseAction.MoveCursor: - NativeMethodsHelper.DoMouseMoveCursor(p); + NativeMethodsHelper.DoMouseMove(p); break; case MouseAction.ScrollDown: - NativeMethodsHelper.DoMouseEventScroll(p, true); + NativeMethodsHelper.DoMouseScroll(p, true); break; case MouseAction.ScrollUp: - NativeMethodsHelper.DoMouseEventScroll(p, false); + NativeMethodsHelper.DoMouseScroll(p, false); break; } } diff --git a/Client/Core/Helper/NativeMethodsHelper.cs b/Client/Core/Helper/NativeMethodsHelper.cs index 2ee3da2b..059eff1b 100644 --- a/Client/Core/Helper/NativeMethodsHelper.cs +++ b/Client/Core/Helper/NativeMethodsHelper.cs @@ -13,22 +13,22 @@ namespace xClient.Core.Helper private const uint KEYEVENTF_KEYDOWN = 0x0000; private const uint KEYEVENTF_KEYUP = 0x0002; - public static void DoMouseEventLeft(Point p, bool isMouseDown) + public static void DoMouseLeftClick(Point p, bool isMouseDown) { NativeMethods.mouse_event(isMouseDown ? MOUSEEVENTF_LEFTDOWN : MOUSEEVENTF_LEFTUP, p.X, p.Y, 0, 0); } - public static void DoMouseEventRight(Point p, bool isMouseDown) + public static void DoMouseRightClick(Point p, bool isMouseDown) { NativeMethods.mouse_event(isMouseDown ? MOUSEEVENTF_RIGHTDOWN : MOUSEEVENTF_RIGHTUP, p.X, p.Y, 0, 0); } - public static void DoMouseMoveCursor(Point p) + public static void DoMouseMove(Point p) { NativeMethods.SetCursorPos(p.X, p.Y); } - public static void DoMouseEventScroll(Point p, bool scrollDown) + public static void DoMouseScroll(Point p, bool scrollDown) { NativeMethods.mouse_event(MOUSEEVENTF_WHEEL, p.X, p.Y, scrollDown ? -120 : 120, 0); } diff --git a/Server/Forms/FrmRemoteDesktop.Designer.cs b/Server/Forms/FrmRemoteDesktop.Designer.cs index bc2c33cb..5c697b6d 100644 --- a/Server/Forms/FrmRemoteDesktop.Designer.cs +++ b/Server/Forms/FrmRemoteDesktop.Designer.cs @@ -28,6 +28,7 @@ /// private void InitializeComponent() { + this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmRemoteDesktop)); this.btnStart = new System.Windows.Forms.Button(); this.btnStop = new System.Windows.Forms.Button(); @@ -40,8 +41,8 @@ this.cbMonitors = new System.Windows.Forms.ComboBox(); this.btnHide = new System.Windows.Forms.Button(); this.btnShow = new System.Windows.Forms.Button(); + this.toolTipButtons = new System.Windows.Forms.ToolTip(this.components); this.picDesktop = new xServer.Controls.RapidPictureBox(); - this.chkForwardCommandKeys = new System.Windows.Forms.CheckBox(); ((System.ComponentModel.ISupportInitialize)(this.barQuality)).BeginInit(); this.panelTop.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.picDesktop)).BeginInit(); @@ -84,7 +85,7 @@ this.lblQuality.AutoSize = true; this.lblQuality.Location = new System.Drawing.Point(167, 5); this.lblQuality.Name = "lblQuality"; - this.lblQuality.Size = new System.Drawing.Size(46, 13); + this.lblQuality.Size = new System.Drawing.Size(47, 13); this.lblQuality.TabIndex = 4; this.lblQuality.Text = "Quality:"; // @@ -104,13 +105,13 @@ this.btnMouse.Name = "btnMouse"; this.btnMouse.Size = new System.Drawing.Size(28, 28); this.btnMouse.TabIndex = 6; + this.toolTipButtons.SetToolTip(this.btnMouse, "Enable mouse input."); this.btnMouse.UseVisualStyleBackColor = true; this.btnMouse.Click += new System.EventHandler(this.btnMouse_Click); // // panelTop // this.panelTop.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.panelTop.Controls.Add(this.chkForwardCommandKeys); this.panelTop.Controls.Add(this.btnKeyboard); this.panelTop.Controls.Add(this.cbMonitors); this.panelTop.Controls.Add(this.btnHide); @@ -127,10 +128,12 @@ // // btnKeyboard // + this.btnKeyboard.Image = global::xServer.Properties.Resources.keyboard_delete; this.btnKeyboard.Location = new System.Drawing.Point(336, 5); this.btnKeyboard.Name = "btnKeyboard"; this.btnKeyboard.Size = new System.Drawing.Size(28, 28); this.btnKeyboard.TabIndex = 9; + this.toolTipButtons.SetToolTip(this.btnKeyboard, "Enable keyboard input."); this.btnKeyboard.UseVisualStyleBackColor = true; this.btnKeyboard.Click += new System.EventHandler(this.btnKeyboard_Click); // @@ -182,17 +185,6 @@ this.picDesktop.MouseMove += new System.Windows.Forms.MouseEventHandler(this.picDesktop_MouseMove); this.picDesktop.MouseUp += new System.Windows.Forms.MouseEventHandler(this.picDesktop_MouseUp); // - // chkForwardCommandKeys - // - this.chkForwardCommandKeys.AutoSize = true; - this.chkForwardCommandKeys.Location = new System.Drawing.Point(234, 39); - this.chkForwardCommandKeys.Name = "chkForwardCommandKeys"; - this.chkForwardCommandKeys.Size = new System.Drawing.Size(149, 17); - this.chkForwardCommandKeys.TabIndex = 10; - this.chkForwardCommandKeys.Text = "Forward Command Keys"; - this.chkForwardCommandKeys.UseVisualStyleBackColor = true; - this.chkForwardCommandKeys.CheckedChanged += new System.EventHandler(this.chkForwardCommandKeys_CheckedChanged); - // // FrmRemoteDesktop // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -233,6 +225,6 @@ private xServer.Controls.RapidPictureBox picDesktop; private System.Windows.Forms.ComboBox cbMonitors; private System.Windows.Forms.Button btnKeyboard; - private System.Windows.Forms.CheckBox chkForwardCommandKeys; + private System.Windows.Forms.ToolTip toolTipButtons; } } \ No newline at end of file diff --git a/Server/Forms/FrmRemoteDesktop.cs b/Server/Forms/FrmRemoteDesktop.cs index 7f563bc9..e399ec2e 100644 --- a/Server/Forms/FrmRemoteDesktop.cs +++ b/Server/Forms/FrmRemoteDesktop.cs @@ -9,6 +9,7 @@ using xServer.Enums; namespace xServer.Forms { + //TODO: Register Hotkeys for WIN - and ALT-key combinations public partial class FrmRemoteDesktop : Form { public bool IsStarted { get; private set; } @@ -182,12 +183,14 @@ namespace xServer.Forms { this.picDesktop.Cursor = Cursors.Default; btnMouse.Image = Properties.Resources.mouse_delete; + toolTipButtons.SetToolTip(btnMouse, "Enable mouse input."); _enableMouseInput = false; } else { this.picDesktop.Cursor = Cursors.Hand; btnMouse.Image = Properties.Resources.mouse_add; + toolTipButtons.SetToolTip(btnMouse, "Disable mouse input."); _enableMouseInput = true; } @@ -196,7 +199,19 @@ namespace xServer.Forms private void btnKeyboard_Click(object sender, EventArgs e) { - _enableKeyboardInput = !_enableKeyboardInput; + if (_enableKeyboardInput) + { + btnKeyboard.Image = Properties.Resources.keyboard_delete; + toolTipButtons.SetToolTip(btnMouse, "Enable keyboard input."); + _enableKeyboardInput = false; + } + else + { + btnKeyboard.Image = Properties.Resources.keyboard_add; + toolTipButtons.SetToolTip(btnMouse, "Disable keyboard input."); + _enableKeyboardInput = true; + } + this.ActiveControl = picDesktop; } @@ -317,17 +332,5 @@ namespace xServer.Forms btnHide.Visible = true; this.ActiveControl = picDesktop; } - - private void chkForwardCommandKeys_CheckedChanged(object sender, EventArgs e) - { - if (chkForwardCommandKeys.Checked) - { - //register hot keys for command keys such as Windows key and ALT + key combinations - } - else - { - - } - } } } \ No newline at end of file diff --git a/Server/Properties/Resources.Designer.cs b/Server/Properties/Resources.Designer.cs index cfda1634..b2f96217 100644 --- a/Server/Properties/Resources.Designer.cs +++ b/Server/Properties/Resources.Designer.cs @@ -200,6 +200,26 @@ namespace xServer.Properties { } } + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap keyboard_add { + get { + object obj = ResourceManager.GetObject("keyboard_add", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap keyboard_delete { + get { + object obj = ResourceManager.GetObject("keyboard_delete", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. /// diff --git a/Server/Properties/Resources.resx b/Server/Properties/Resources.resx index 4e0d8d25..edd938b0 100644 --- a/Server/Properties/Resources.resx +++ b/Server/Properties/Resources.resx @@ -239,12 +239,18 @@ ..\images\application_delete.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\images\keyboard_add.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\images\logger.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\images\run.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\images\registry.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\images\server-disconnect.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -255,7 +261,7 @@ ..\images\information.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\images\registry.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\images\keyboard_delete.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a \ No newline at end of file diff --git a/Server/images/keyboard_add.png b/Server/images/keyboard_add.png new file mode 100644 index 00000000..26938dd0 Binary files /dev/null and b/Server/images/keyboard_add.png differ diff --git a/Server/images/keyboard_delete.png b/Server/images/keyboard_delete.png new file mode 100644 index 00000000..1786ed5b Binary files /dev/null and b/Server/images/keyboard_delete.png differ