Esempio n. 1
0
        override protected bool InnerHandle(WiimoteState currentState, WiimoteState lastState)
        {
            if (currentState.IRState.Found1 && lastState.IRState.Found1)
            {
                PointF warpedCoordinates = CursorWarper.warp(new PointF(currentState.IRState.RawX1, currentState.IRState.RawY1));

                mouseDownEndPoint.X = warpedCoordinates.X;
                mouseDownEndPoint.Y = warpedCoordinates.Y;

                CursorSmoother.smoothCursor(warpedCoordinates);

                INPUT[] buffer = CreateMouseInput();

                SendInput(1, buffer, Marshal.SizeOf(buffer[0]));

                return(true);
            }

            return(false);
        }
Esempio n. 2
0
        override protected bool InnerHandle(WiimoteState currentState, WiimoteState lastState)
        {
            if (currentState.IRState.Found1 && !lastState.IRState.Found1)
            {
                PointF warpedCoordinates = CursorWarper.warp(new PointF(currentState.IRState.RawX1, currentState.IRState.RawY1));

                mouseDownStartPoint.X = warpedCoordinates.X;
                mouseDownStartPoint.Y = warpedCoordinates.Y;
                mouseDownStartTime    = DateTime.Now.Ticks;

                CursorSmoother.smoothCursor(warpedCoordinates);
                CursorSmoother.SmoothingBufferIndex = 0;

                INPUT[] buffer = CreateMouseInput(ref warpedCoordinates);

                SendInput(2, buffer, Marshal.SizeOf(buffer[0]));

                return(true);
            }

            return(false);
        }