static Func <bool> CreatePressTestFuncJoy(InputControlType key, KeyPressType pressType, float[] para) { if (InputControlType.None == key) { return(() => false); } switch (pressType) { default: return(() => false); case KeyPressType.JoyDown: return(() => InputManager.ActiveDevice.GetControl(key).WasPressed); case KeyPressType.JoyUp: return(() => InputManager.ActiveDevice.GetControl(key).WasReleased); case KeyPressType.JoyPress: return(() => InputManager.ActiveDevice.GetControl(key).IsPressed); case KeyPressType.JoyStickUpDoublePress: JoyAxisStateInfo.Register(InputControlType.LeftStickY, para); return(() => JoyAxisStateInfo.GetValue(InputControlType.LeftStickY).positiveDoubleDown); case KeyPressType.JoyStickDownDoublePress: JoyAxisStateInfo.Register(InputControlType.LeftStickY, para); return(() => JoyAxisStateInfo.GetValue(InputControlType.LeftStickY).negativeDoubleDown); case KeyPressType.JoyStickRightDoublePress: JoyAxisStateInfo.Register(InputControlType.LeftStickX, para); return(() => JoyAxisStateInfo.GetValue(InputControlType.LeftStickX).positiveDoubleDown); case KeyPressType.JoyStickLeftDoublePress: JoyAxisStateInfo.Register(InputControlType.LeftStickX, para); return(() => JoyAxisStateInfo.GetValue(InputControlType.LeftStickX).negativeDoubleDown); } }
static void ResetPressInfo() { ClickPressInfo.Clear(); ClickCDPressInfo.Clear(); DoublePressInfo.Clear(); LongPressInfo.Clear(); JoyAxisStateInfo.Clear(); }