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(); }