Example #1
0
 public virtual void touchesMoved(object sender, TouchpadEventArgs arg)
 {
     if (!Global.UseTPforControls[deviceNum])
     {
         cursor.touchesMoved(arg);
         wheel.touchesMoved(arg);
     }
     else
     {
         if (!(swipeUp || swipeDown || swipeLeft || swipeRight) && arg.touches.Length == 1)
         {
             if (arg.touches[0].hwX - firstTouch.hwX > 400)
             {
                 swipeRight = true;
             }
             if (arg.touches[0].hwX - firstTouch.hwX < -400)
             {
                 swipeLeft = true;
             }
             if (arg.touches[0].hwY - firstTouch.hwY > 300)
             {
                 swipeDown = true;
             }
             if (arg.touches[0].hwY - firstTouch.hwY < -300)
             {
                 swipeUp = true;
             }
         }
         swipeUpB    = (byte)Math.Min(255, Math.Max(0, (firstTouch.hwY - arg.touches[0].hwY) * 1.5f));
         swipeDownB  = (byte)Math.Min(255, Math.Max(0, (arg.touches[0].hwY - firstTouch.hwY) * 1.5f));
         swipeLeftB  = (byte)Math.Min(255, Math.Max(0, firstTouch.hwX - arg.touches[0].hwX));
         swipeRightB = (byte)Math.Min(255, Math.Max(0, arg.touches[0].hwX - firstTouch.hwX));
     }
     if (Math.Abs(firstTouch.hwY - arg.touches[0].hwY) < 50 && arg.touches.Length == 2)
     {
         if (arg.touches[0].hwX - firstTouch.hwX > 200 && !slideleft)
         {
             slideright = true;
         }
         else if (firstTouch.hwX - arg.touches[0].hwX > 200 && !slideright)
         {
             slideleft = true;
         }
     }
     dev.getCurrentState(s);
     synthesizeMouseButtons();
 }
Example #2
0
        public static bool shiftMod(IEAll4Device ieAll4Device, int deviceNum, ControllerState cState, EAll4StateExposed eState, Mouse tp)
        {
            bool shift;

            switch (Global.ShiftModifier[deviceNum])
            {
            case 1: shift = Mapping.getBoolMapping(GenericControls.A, cState, eState, tp); break;

            case 2: shift = Mapping.getBoolMapping(GenericControls.B, cState, eState, tp); break;

            case 3: shift = Mapping.getBoolMapping(GenericControls.X, cState, eState, tp); break;

            case 4: shift = Mapping.getBoolMapping(GenericControls.Y, cState, eState, tp); break;

            case 5: shift = Mapping.getBoolMapping(GenericControls.Start, cState, eState, tp); break;

            case 6: shift = Mapping.getBoolMapping(GenericControls.Back, cState, eState, tp); break;

            case 7: shift = Mapping.getBoolMapping(GenericControls.DpadUp, cState, eState, tp); break;

            case 8: shift = Mapping.getBoolMapping(GenericControls.DpadDown, cState, eState, tp); break;

            case 9: shift = Mapping.getBoolMapping(GenericControls.DpadLeft, cState, eState, tp); break;

            case 10: shift = Mapping.getBoolMapping(GenericControls.DpadRight, cState, eState, tp); break;

            case 11: shift = Mapping.getBoolMapping(GenericControls.Guide, cState, eState, tp); break;

            case 12: shift = Mapping.getBoolMapping(GenericControls.LB, cState, eState, tp); break;

            case 13: shift = Mapping.getBoolMapping(GenericControls.RB, cState, eState, tp); break;

            case 14: shift = Mapping.getBoolMapping(GenericControls.LT, cState, eState, tp); break;

            case 15: shift = Mapping.getBoolMapping(GenericControls.RT, cState, eState, tp); break;

            case 16: shift = Mapping.getBoolMapping(GenericControls.LS, cState, eState, tp); break;

            case 17: shift = Mapping.getBoolMapping(GenericControls.RS, cState, eState, tp); break;

            case 18: shift = Mapping.getBoolMapping(GenericControls.TouchLeft, cState, eState, tp); break;

            case 19: shift = Mapping.getBoolMapping(GenericControls.TouchUpper, cState, eState, tp); break;

            case 20: shift = Mapping.getBoolMapping(GenericControls.TouchMulti, cState, eState, tp); break;

            case 21: shift = Mapping.getBoolMapping(GenericControls.TouchRight, cState, eState, tp); break;

            case 22: shift = Mapping.getBoolMapping(GenericControls.GyroZNeg, cState, eState, tp); break;

            case 23: shift = Mapping.getBoolMapping(GenericControls.GyroZPos, cState, eState, tp); break;

            case 24: shift = Mapping.getBoolMapping(GenericControls.GyroXPos, cState, eState, tp); break;

            case 25: shift = Mapping.getBoolMapping(GenericControls.GyroXNeg, cState, eState, tp); break;

            case 26: shift = ieAll4Device.getCurrentState().Touch1; break;

            default: shift = false; break;
            }
            return(shift);
        }