예제 #1
0
        // Move mouse
        public void MoveMouse()
        {
            // Get current position
            var curr_pos = CursorHelper.GetCurrentPosition();

            // Move cursor only if position is not changed, in order to not disturb if the user is working
            if (curr_pos == mLastCursorPos)
            {
                // Get pixel movement depending on the direction
                int mov_pixel_rel = (mMovingDir == eMovingDirections.BACKWARD) ? (-1 * mMovingPixel) : mMovingPixel;
                // Move cursor
                MoveCursor(mov_pixel_rel);
                // Update moving direction
                UpdateMovingDir();
            }

            // Reset last cursor position
            mLastCursorPos = CursorHelper.GetCurrentPosition();
        }
예제 #2
0
 // Initialize
 public void Initialize(int cMovingPixel)
 {
     mMovingDir     = eMovingDirections.FORWARD;
     mMovingPixel   = cMovingPixel;
     mLastCursorPos = CursorHelper.GetCurrentPosition();
 }