From caf75e242770bf2d6f1b14a6e35fd1018722b819 Mon Sep 17 00:00:00 2001 From: liufei Date: Mon, 20 Dec 2021 09:56:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8D=E5=BC=80=E5=90=AF=E4=B8=AD=E9=94=AE?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E6=97=B6=E4=B8=8D=E5=86=8D=E5=8D=A0=E7=94=A8?= =?UTF-8?q?=E7=BA=BF=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Control/UserControls/Config/MotionControl.xaml | 2 +- Control/UserControls/Config/MotionControl.xaml.cs | 9 ++++++++- MainWindow.xaml.cs | 10 ++++++++-- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/Control/UserControls/Config/MotionControl.xaml b/Control/UserControls/Config/MotionControl.xaml index 30c8cc5..5605c17 100644 --- a/Control/UserControls/Config/MotionControl.xaml +++ b/Control/UserControls/Config/MotionControl.xaml @@ -41,7 +41,7 @@ - + diff --git a/Control/UserControls/Config/MotionControl.xaml.cs b/Control/UserControls/Config/MotionControl.xaml.cs index 43f9a3b..c32b449 100644 --- a/Control/UserControls/Config/MotionControl.xaml.cs +++ b/Control/UserControls/Config/MotionControl.xaml.cs @@ -1,5 +1,6 @@ using GeekDesk.Constant; using GeekDesk.Control.Windows; +using GeekDesk.Thread; using GeekDesk.Util; using GeekDesk.ViewModel; using HandyControl.Data; @@ -280,7 +281,13 @@ namespace GeekDesk.Control.UserControls.Config /// private void MouseMiddle_Changed(object sender, RoutedEventArgs e) { - + if (appConfig.MouseMiddleShow) + { + MouseHookThread.MiddleHook(); + } else + { + MouseHookThread.Dispose(); + } } private void HookListener_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e) diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index fcc54f6..035d194 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -107,7 +107,10 @@ namespace GeekDesk } //注册鼠标中键监听事件 - MouseHookThread.MiddleHook(); + if (appData.AppConfig.MouseMiddleShow) + { + MouseHookThread.MiddleHook(); + } //更新线程开启 检测更新 UpdateThread.Update(); @@ -396,7 +399,10 @@ namespace GeekDesk /// private void ExitApp(object sender, RoutedEventArgs e) { - MouseHookThread.Dispose(); + if (appData.AppConfig.MouseMiddleShow) + { + MouseHookThread.Dispose(); + } Application.Current.Shutdown(); }