Beispiel #1
0
        public void Stop()
        {
            // TODO : if (!Hook.Enabled) return;

            if (Config == null)
            {
                return;
            }

            Hook.MouseMove -= _handler;

            if (Config.AdjustPointer)
            {
                ZoneChanged -= AdjustPointer;
            }

            if (Config.AdjustSpeed)
            {
                ZoneChanged -= AdjustSpeed;
            }

            if (Config.HomeCinema)
            {
                ZoneChanged -= HomeCinema;
            }

            Hook.UnHook();

            if (Config == null)
            {
                return;
            }

            if (Config.AdjustSpeed)
            {
                LbmMouse.MouseSpeed = _initMouseSpeed;
                using (var key = ScreenConfig.OpenRootRegKey(true))
                {
                    key.DeleteValue("InitialMouseSpeed");
                }
            }

            if (Config.AdjustPointer)
            {
                using (var key = ScreenConfig.OpenRootRegKey())
                {
                    using (RegistryKey savekey = key.OpenSubKey("InitialCursor"))
                    {
                        if (savekey != null)
                        {
                            LbmMouse.RestoreCursor(savekey);
                        }
                    }
                    key.DeleteSubKey("InitialCursor");
                }
            }

            Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.Normal;
        }
Beispiel #2
0
        public void Stop()
        {
            SystemEvents.DisplaySettingsChanged -= OnDisplaySettingsChanged;

            if (!Hook.Enabled)
            {
                return;
            }

            Hook.MouseMoveExt -= OnMouseMoveExt;
            Hook.Enabled       = false;
            //           LittleBigMouseDaemon.Callback?.OnStateChange();

            if (Config == null)
            {
                return;
            }

            if (Config.AdjustSpeed)
            {
                LbmMouse.MouseSpeed = _initMouseSpeed;
                using (var key = ScreenConfig.OpenRootRegKey(true))
                {
                    key.DeleteValue("InitialMouseSpeed");
                }
            }

            if (Config.AdjustPointer)
            {
                using (var key = ScreenConfig.OpenRootRegKey())
                {
                    using (RegistryKey savekey = key.OpenSubKey("InitialCursor"))
                    {
                        if (savekey != null)
                        {
                            LbmMouse.RestoreCursor(savekey);
                        }
                    }
                    key.DeleteSubKey("InitialCursor");
                }
            }

            Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.Normal;
        }