From 8d61d71767f39c72586577eba6ab023b45a6dfef Mon Sep 17 00:00:00 2001 From: Lesueur Benjamin Date: Sat, 13 Nov 2021 17:14:38 +0100 Subject: [PATCH] speedup mousehook --- ControllerHelper/MouseHook.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ControllerHelper/MouseHook.cs b/ControllerHelper/MouseHook.cs index fdcdfe568..57eec1d8a 100644 --- a/ControllerHelper/MouseHook.cs +++ b/ControllerHelper/MouseHook.cs @@ -1,5 +1,6 @@ using ControllerService; using Gma.System.MouseKeyHook; +using System; using System.Threading; using System.Timers; using System.Windows.Forms; @@ -53,9 +54,7 @@ private void OnMouseDown(object sender, MouseEventExtArgs e) private void OnMouseMove(object sender, MouseEventExtArgs e) { - short TouchX = (short)(e.X); - short TouchY = (short)(e.Y); - client.SendMessage(new PipeMessage { Code = PipeCode.CODE_CURSOR_MOVE, args = new string[] { TouchX.ToString(), TouchY.ToString() } }); + client.SendMessage(new PipeMessage { Code = PipeCode.CODE_CURSOR_MOVE, args = new string[] { Convert.ToString(e.X), Convert.ToString(e.Y) } }); } private void OnMouseUp(object sender, MouseEventExtArgs e)