예제 #1
0
 public virtual void touchButtonUp(object sender, TouchpadEventArgs arg)
 {
     pushed    = GenericControls.None;
     upperDown = leftDown = rightDown = multiDown = false;
     dev.setRumble(0, 0);
     dev.getCurrentState(s);
     if (s.Touch1 || s.Touch2)
     {
         synthesizeMouseButtons();
     }
 }
예제 #2
0
        private void DoExtras(int ind)
        {
            ControllerState   cState   = CurrentState[ind];
            EAll4StateExposed eState   = ExposedState[ind];
            Mouse             tp       = touchPad[ind];
            GenericControls   helddown = GenericControls.None;

            foreach (KeyValuePair <GenericControls, string> p in Global.getCustomExtras(ind))
            {
                if (Mapping.getBoolMapping(p.Key, cState, eState, tp))
                {
                    helddown = p.Key;
                    break;
                }
            }
            if (helddown != GenericControls.None)
            {
                string   p      = Global.getCustomExtras(ind)[helddown];
                string[] extraS = p.Split(',');
                int[]    extras = new int[extraS.Length];
                for (int i = 0; i < extraS.Length; i++)
                {
                    int b;
                    if (int.TryParse(extraS[i], out b))
                    {
                        extras[i] = b;
                    }
                }
                held[ind] = true;
                try
                {
                    if (!(extras[0] == extras[1] && extras[1] == 0))
                    {
                        setRumble((byte)extras[0], (byte)extras[1], ind);
                    }
                    if (extras[2] == 1)
                    {
                        EAll4Color color = new EAll4Color {
                            Red = (byte)extras[3], Green = (byte)extras[4], Blue = (byte)extras[5]
                        };
                        EAll4LightBar.forcedColor[ind] = color;
                        EAll4LightBar.forcedFlash[ind] = (byte)extras[6];
                        EAll4LightBar.forcelight[ind]  = true;
                    }
                    if (extras[7] == 1)
                    {
                        if (oldmouse[ind] == -1)
                        {
                            oldmouse[ind] = Global.ButtonMouseSensitivity[ind];
                        }
                        Global.ButtonMouseSensitivity[ind] = extras[8];
                    }
                }
                catch { }
            }
            else if (held[ind])
            {
                EAll4LightBar.forcelight[ind]      = false;
                EAll4LightBar.forcedFlash[ind]     = 0;
                Global.ButtonMouseSensitivity[ind] = oldmouse[ind];
                oldmouse[ind] = -1;
                setRumble(0, 0, ind);
                held[ind] = false;
            }
        }