Exemplo n.º 1
0
        public virtual void sixaxisMoved(object sender, SixAxisEventArgs arg)
        {
            if (Global.isUsingSAforMouse(deviceNum) && Global.getGyroSensitivity(deviceNum) > 0)
            {
                s = dev.getCurrentStateRef();

                useReverseRatchet = Global.getGyroTriggerTurns(deviceNum);
                int      i       = 0;
                string[] ss      = Global.getSATriggers(deviceNum).Split(',');
                bool     andCond = Global.getSATriggerCond(deviceNum);
                triggeractivated = andCond ? true : false;
                if (!string.IsNullOrEmpty(ss[0]))
                {
                    string s = string.Empty;
                    for (int index = 0, arlen = ss.Length; index < arlen; index++)
                    {
                        s = ss[index];
                        if (andCond && !(int.TryParse(s, out i) && getDS4ControlsByName(i)))
                        {
                            triggeractivated = false;
                            break;
                        }
                        else if (!andCond && int.TryParse(s, out i) && getDS4ControlsByName(i))
                        {
                            triggeractivated = true;
                            break;
                        }
                    }
                }

                if (useReverseRatchet && triggeractivated)
                {
                    cursor.sixaxisMoved(arg);
                }
                else if (!useReverseRatchet && !triggeractivated)
                {
                    cursor.sixaxisMoved(arg);
                }
                else
                {
                    cursor.mouseRemainderReset();
                }
            }
        }