本文整理汇总了C#中MyJoystickButtonsEnum类的典型用法代码示例。如果您正苦于以下问题:C# MyJoystickButtonsEnum类的具体用法?C# MyJoystickButtonsEnum怎么用?C# MyJoystickButtonsEnum使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MyJoystickButtonsEnum类属于命名空间,在下文中一共展示了MyJoystickButtonsEnum类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsJoystickButtonValid
// Return true if joystick button is valid for user controls
bool ModAPI.IMyInput.IsJoystickButtonValid(MyJoystickButtonsEnum button) { return IsJoystickButtonValid(button); }
示例2: return
// Check to see if a specific button on the joystick is pressed.
bool ModAPI.IMyInput.IsJoystickButtonPressed(MyJoystickButtonsEnum button) { return ((IMyInput)this).IsJoystickButtonPressed(button); }
示例3:
bool IMyInput.IsJoystickButtonNewPressed(MyJoystickButtonsEnum button) { return false; }
示例4: IsJoystickButtonNewPressed
// Check to see if a specific button on the joystick is currently pressed and was not pressed during the last update.
bool ModAPI.IMyInput.IsJoystickButtonNewPressed(MyJoystickButtonsEnum button) { return IsJoystickButtonNewPressed(button); }
示例5: GetName
public string GetName(MyJoystickButtonsEnum joystickButton)
{
return m_nameLookup.GetName(joystickButton);
}
示例6: SetNoControl
public void SetNoControl()
{
m_joystickAxis = MyJoystickAxesEnum.None;
m_joystickButton = MyJoystickButtonsEnum.None;
m_mouseButton = MyMouseButtonsEnum.None;
m_keyboardKey = Keys.None;
m_keyboardKey2 = Keys.None;
}
示例7: WasJoystickButtonReleased
// Check to see if a specific button on the joystick was released.
public bool WasJoystickButtonReleased(MyJoystickButtonsEnum button)
{
bool wasReleased = false;
//if (m_joystickConnected && button != MyJoystickButtonsEnum.None && m_previousJoystickState != null)
if (IsJoystickConnected() && button != MyJoystickButtonsEnum.None)
{
GamepadButtonFlags flags = JoystickHelper.VRageToXInput(button);
switch (button)
{
case MyJoystickButtonsEnum.J11:
wasReleased = !IsGamepadLTriggerPressed(m_previousJoystickState.Gamepad);
break;
case MyJoystickButtonsEnum.J12:
wasReleased = !IsGamepadRTriggerPressed(m_previousJoystickState.Gamepad);
break;
//default: wasReleased = (m_previousJoystickState.IsReleased((int)button - 5)); break;
default: wasReleased = (m_previousJoystickState.Gamepad.Buttons & flags) == 0x0; break;
}
}
if (!wasReleased && button == MyJoystickButtonsEnum.None)
{
return true;
}
return wasReleased;
}
示例8: MyControl
public MyControl(MyEditorControlEnums control, MyTextsWrapperEnum text, MyGuiControlTypeEnum controlType)
{
m_editorControl = control;
m_gameControlType = MyGuiGameControlType.EDITOR;
m_text = text;
m_controlType = controlType;
m_joystickButton = MyJoystickButtonsEnum.None;
m_joystickAxis = MyJoystickAxesEnum.None;
m_mouseButton = MyMouseButtonsEnum.None;
m_keyboardKey = Keys.None;
}
示例9: SetControl
public void SetControl(MyJoystickButtonsEnum joyButton)
{
m_joystickButton = joyButton;
}
示例10: switch
string IMyControlNameLookup.GetName(MyJoystickButtonsEnum joystickButton)
{
if (joystickButton == MyJoystickButtonsEnum.None)
return "";
switch (joystickButton)
{
case MyJoystickButtonsEnum.JDLeft: return MyTexts.GetString(MyCommonTexts.JoystickButtonLeft);
case MyJoystickButtonsEnum.JDRight: return MyTexts.GetString(MyCommonTexts.JoystickButtonRight);
case MyJoystickButtonsEnum.JDUp: return MyTexts.GetString(MyCommonTexts.JoystickButtonUp);
case MyJoystickButtonsEnum.JDDown: return MyTexts.GetString(MyCommonTexts.JoystickButtonDown);
default:
return "JB" + ((int)joystickButton - 4);
}
}
示例11: IsJoystickButtonPressed
// Check to see if a specific button on the joystick is pressed.
public bool IsJoystickButtonPressed(MyJoystickButtonsEnum button)
{
bool isPressed = false;
if (IsJoystickConnected() && button != MyJoystickButtonsEnum.None)
{
switch (button)
{
case MyJoystickButtonsEnum.J11:
isPressed = IsGamepadLTriggerPressed(m_actualJoystickState.Gamepad);
break;
case MyJoystickButtonsEnum.J12:
isPressed = IsGamepadRTriggerPressed(m_actualJoystickState.Gamepad);
break;
default: isPressed = (m_actualJoystickState.Gamepad.Buttons & JoystickHelper.VRageToXInput(button)) != 0x0; break;
}
}
if (!isPressed && button == MyJoystickButtonsEnum.None)
{
return true;
}
return isPressed;
}
示例12: AppendName
public static void AppendName(ref StringBuilder output, MyJoystickButtonsEnum joystickButton)
{
EnsureExists(ref output);
output.Append(MyInput.Static.GetName(joystickButton));
}
示例13: IsNewJoystickButtonReleased
public bool IsNewJoystickButtonReleased(MyJoystickButtonsEnum button)
{
bool isReleased = false;
//if (m_joystickConnected && button != MyJoystickButtonsEnum.None && m_actualJoystickState != null && m_previousJoystickState != null)
if (IsJoystickConnected() && button != MyJoystickButtonsEnum.None) // && m_actualJoystickState != null && m_previousJoystickState != null)
{
GamepadButtonFlags flags = JoystickHelper.VRageToXInput(button);
switch (button)
{
case MyJoystickButtonsEnum.J11:
isReleased = (!IsGamepadLTriggerPressed(m_actualJoystickState.Gamepad)) &&
IsGamepadLTriggerPressed(m_previousJoystickState.Gamepad);
break;
case MyJoystickButtonsEnum.J12:
isReleased = (!IsGamepadRTriggerPressed(m_actualJoystickState.Gamepad)) &&
IsGamepadRTriggerPressed(m_previousJoystickState.Gamepad);
break;
//default: isReleased = ((m_actualJoystickState.IsReleased((int)button - 5)) && (m_previousJoystickState.IsPressed((int)button - 5))); break;
default: isReleased = ((m_actualJoystickState.Gamepad.Buttons & flags) == 0x0) &&
((m_previousJoystickState.Gamepad.Buttons & flags) != 0x0); break;
}
}
if (!isReleased && button == MyJoystickButtonsEnum.None)
{
return true;
}
return isReleased;
}
示例14: VRageToXInput
static public uint VRageToXInput(MyJoystickButtonsEnum button)
{
return (uint)(kArrVRageToXInput[(byte)button]);
}
示例15: IsJoystickButtonValid
// Return true if joystick button is valid for user controls
public bool IsJoystickButtonValid(MyJoystickButtonsEnum button)
{
foreach (var item in m_validJoystickButtons)
{
if (item == button) return true;
}
return false;
}