public static int GetDirectionIndex(NintendoSwitch.ECKey key)
        {
            int x = key.StickX;
            int y = key.StickY;

            if (x == NSwitchUtil.STICK_CENTER && y == NSwitchUtil.STICK_CENTER)
            {
                return(-1);
            }
            x = (int)Math.Round(x / 32d);
            y = (int)Math.Round(y / 32d);
            return(x >= y ? x + y : 32 - x - y);
        }
Exemple #2
0
 public KeyAction(NintendoSwitch.ECKey key)
 {
     Key = key;
 }
Exemple #3
0
 public KeyPress(NintendoSwitch.ECKey key, ValBase duration)
     : base(key)
 {
     Duration = duration;
 }
Exemple #4
0
 public KeyPress(NintendoSwitch.ECKey key)
     : base(key)
 {
     Duration = DefaultDuration;
     _omitted = true;
 }
Exemple #5
0
 public KeyUp(NintendoSwitch.ECKey key)
     : base(key)
 {
 }
Exemple #6
0
 public KeyDown(NintendoSwitch.ECKey key)
     : base(key)
 {
 }