コード例 #1
0
        public Win32MousePathTracker2()
        {
            var dpiFactor = Native.GetScreenDpi() / 96.0f;

            //properties defaults
            TriggerButton            = /*GestureButtons.RightButton |*/ GestureTriggerButton.Middle;
            InitialValidMove         = (int)(5 * dpiFactor);
            InitialStayTimeout       = true;
            InitialStayTimeoutMillis = 150;

            EffectiveMove            = (int)(10 * dpiFactor) * 2; //todo: 增加灵敏度调整
            StepSize                 = 3;                         // EffectiveMove/4;// (int) (EffectiveMove * 0.8 * dpiFactor);// EffectiveMove/8;
            StayTimeout              = false;
            PerformNormalWhenTimeout = false;

            _mouseKbdHook = new MouseKeyboardHook();
            _mouseKbdHook.MouseHookEvent += MouseHookProc;

            //_mouseKbdHook.KeyboardHookEvent += KeyboardHookProc;

            //Touch Only Support Win8+
            if (OSVersion.Major >= 6 && OSVersion.Minor > 1)
            {
                //太难弄,暂时屏蔽
                //_touchHook = new TouchHook();
            }

            _edgeDetector      = new EdgeInteractDetector(_mouseKbdHook);
            _edgeDetector.Rub += EdgeDetector_Rub;

            //virtual gesturing
        }
コード例 #2
0
        public EdgeInteractDetector(MouseKeyboardHook mouseHook)
        {
            //_dpiScale = (Native.GetScreenDpi() / 96.0f);
            //_screenBounds = Native.GetScreenBounds();
            //Microsoft.Win32.SystemEvents.DisplaySettingsChanged += SystemEvents_DisplaySettingsChanged;

            _hook = mouseHook;
            _hook.MouseHookEvent += _hook_MouseHookEvent;

            _activeCollideEdge = null;
        }