コード例 #1
0
        public void Start()
        {
            Stop();

            LoadConfig();

            if (Config == null || !Config.Enabled)
            {
                return;
            }

            using (RegistryKey key = ScreenConfig.OpenRootRegKey(true))
            {
                string ms = key.GetValue("InitialMouseSpeed", string.Empty).ToString();

                if (string.IsNullOrEmpty(ms))
                {
                    _initMouseSpeed = LbmMouse.MouseSpeed;
                    key.SetValue("InitialMouseSpeed", _initMouseSpeed.ToString(CultureInfo.InvariantCulture),
                                 RegistryValueKind.String);
                }
                else
                {
                    double.TryParse(ms, out _initMouseSpeed);
                }

                using (RegistryKey savekey = key.CreateSubKey("InitialCursor"))
                {
                    if (savekey?.ValueCount == 0)
                    {
                        LbmMouse.SaveCursor(savekey);
                    }
                }
            }

            Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.RealTime;


            _handler           = OnMouseMoveExtFirst;
            Hook.MouseMoveExt += _handler;

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

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

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


            Hook.Enabled = true;
        }
コード例 #2
0
        public void Start()
        {
            if (Hook.Enabled)
            {
                return;
            }

            if (Config == null)
            {
                LoadConfig();
            }

            if (Config == null || !Config.Enabled)
            {
                return;
            }

            SystemEvents.DisplaySettingsChanged += OnDisplaySettingsChanged;

            using (RegistryKey key = ScreenConfig.OpenRootRegKey(true))
            {
                string ms = key.GetValue("InitialMouseSpeed", string.Empty).ToString();

                if (string.IsNullOrEmpty(ms))
                {
                    _initMouseSpeed = LbmMouse.MouseSpeed;
                    key.SetValue("InitialMouseSpeed", _initMouseSpeed.ToString(CultureInfo.InvariantCulture), RegistryValueKind.String);
                }
                else
                {
                    double.TryParse(ms, out _initMouseSpeed);
                }

                using (RegistryKey savekey = key.CreateSubKey("InitialCursor"))
                {
                    if (savekey?.ValueCount == 0)
                    {
                        LbmMouse.SaveCursor(savekey);
                    }
                }
            }

            Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.RealTime;

            Hook.MouseMoveExt += OnMouseMoveExt;
            Hook.Enabled       = true;
            //           LittleBigMouseDaemon.Callback?.OnStateChange();
        }