Esempio n. 1
0
        public void Calibrate(CalibrationData data)
        {
            CalibrationData dst = LoadDestinationData();

            CursorWarper.setDestination(dst.X[0], dst.Y[0], dst.X[1], dst.Y[1], dst.X[2], dst.Y[2], dst.X[3], dst.Y[3]);
            CursorWarper.setSource(data.X[0], data.Y[0], data.X[1], data.Y[1], data.X[2], data.Y[2], data.X[3], data.Y[3]);
            CursorWarper.computeWarp();
        }
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));

                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. 3
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);
        }