コード例 #1
0
        private void Timer_Elapsed(object sender, ElapsedEventArgs e)
        {
            Point currentMousePos = MouseDetector.GetMousePosition();

            if (currentMousePos != lastMousePos)
            {
                OnMouseMoved(currentMousePos);

                lastMousePos = currentMousePos;
            }
        }
コード例 #2
0
        public MouseDetector(Resolution resolution, DataPrecision precision)
        {
            lastMousePos = MouseDetector.GetMousePosition();

            double frequency = CalcTimerFrequency(resolution, precision);

            timer           = new Timer(frequency);
            timer.Elapsed  += Timer_Elapsed;
            timer.AutoReset = true;
            timer.Start();
        }