• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# MyJoystickButtonsEnum类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中MyJoystickButtonsEnum的典型用法代码示例。如果您正苦于以下问题:C# MyJoystickButtonsEnum类的具体用法?C# MyJoystickButtonsEnum怎么用?C# MyJoystickButtonsEnum使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MyJoystickButtonsEnum类属于命名空间,在下文中一共展示了MyJoystickButtonsEnum类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: IsJoystickButtonValid

 //  Return true if joystick button is valid for user controls
 bool ModAPI.IMyInput.IsJoystickButtonValid(MyJoystickButtonsEnum button) { return IsJoystickButtonValid(button); }
开发者ID:2asoft,项目名称:SpaceEngineers,代码行数:2,代码来源:MyDirectXInput_ModAPI.cs


示例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); }
开发者ID:2asoft,项目名称:SpaceEngineers,代码行数:2,代码来源:MyNullInput_ModAPI.cs


示例3:

 bool IMyInput.IsJoystickButtonNewPressed(MyJoystickButtonsEnum button) { return false; }
开发者ID:fluxit,项目名称:SpaceEngineers,代码行数:1,代码来源:MyNullInput.cs


示例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); }
开发者ID:2asoft,项目名称:SpaceEngineers,代码行数:2,代码来源:MyDirectXInput_ModAPI.cs


示例5: GetName

 public string GetName(MyJoystickButtonsEnum joystickButton)
 {
     return m_nameLookup.GetName(joystickButton);
 }
开发者ID:ales-vilchytski,项目名称:SpaceEngineers,代码行数:4,代码来源:MyXInputInput.cs


示例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;
 }
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:8,代码来源:MyControl.cs


示例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;
 }
开发者ID:ales-vilchytski,项目名称:SpaceEngineers,代码行数:26,代码来源:MyXInputInput.cs


示例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;
 }
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:11,代码来源:MyControl.cs


示例9: SetControl

 public void SetControl(MyJoystickButtonsEnum joyButton)
 {
     m_joystickButton = joyButton;
 }
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:4,代码来源:MyControl.cs


示例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);
            }
        }
开发者ID:2asoft,项目名称:SpaceEngineers,代码行数:16,代码来源:MyKeysToString.cs


示例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;
 }
开发者ID:ales-vilchytski,项目名称:SpaceEngineers,代码行数:23,代码来源:MyXInputInput.cs


示例12: AppendName

 public static void AppendName(ref StringBuilder output, MyJoystickButtonsEnum joystickButton)
 {
     EnsureExists(ref output);
     output.Append(MyInput.Static.GetName(joystickButton));
 }
开发者ID:fluxit,项目名称:SpaceEngineers,代码行数:5,代码来源:MyControl.cs


示例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;
 }
开发者ID:ales-vilchytski,项目名称:SpaceEngineers,代码行数:28,代码来源:MyXInputInput.cs


示例14: VRageToXInput

 static public uint VRageToXInput(MyJoystickButtonsEnum button)
 {
     return (uint)(kArrVRageToXInput[(byte)button]);
 }
开发者ID:2asoft,项目名称:SpaceEngineers,代码行数:4,代码来源:MyXInputInput.cs


示例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;
 }
开发者ID:ales-vilchytski,项目名称:SpaceEngineers,代码行数:9,代码来源:MyXInputInput.cs


示例16: JoystickButton

 public JoystickButton(MyJoystickButtonsEnum button) { Button = button; }
开发者ID:2asoft,项目名称:SpaceEngineers,代码行数:1,代码来源:MyControllerHelper.cs


示例17: VRageToXInput

 static public GamepadButtonFlags VRageToXInput(MyJoystickButtonsEnum button)
 {
     return kArrVRageToXInput[(byte)button];
 }
开发者ID:ales-vilchytski,项目名称:SpaceEngineers,代码行数:4,代码来源:MyXInputInput.cs


示例18: AddControl

 public static void AddControl(MyStringId context, MyStringId stringId, MyJoystickButtonsEnum button)
 {
     m_bindings[context][stringId] = new JoystickButton(button);
 }
开发者ID:2asoft,项目名称:SpaceEngineers,代码行数:4,代码来源:MyControllerHelper.cs


示例19: NullControl

 public static void NullControl(MyStringId context, MyJoystickButtonsEnum button)
 {
     MyStringId key = MyStringId.NullOrEmpty;
     foreach (var pair in m_bindings[context].Bindings)
     {
         if (pair.Value is JoystickButton && pair.Value.Code == (byte)button)
         {
             key = pair.Key;
             break;
         }
     }
     if (key != MyStringId.NullOrEmpty)
         m_bindings[context][key] = m_nullControl;
 }
开发者ID:2asoft,项目名称:SpaceEngineers,代码行数:14,代码来源:MyControllerHelper.cs


示例20: IsJoystickButtonReleased

 public bool IsJoystickButtonReleased(MyJoystickButtonsEnum button)
 {
     bool isReleased = false;
     if (m_joystickConnected && button != MyJoystickButtonsEnum.None && m_actualJoystickState != null)
     {
         switch (button)
         {
             case MyJoystickButtonsEnum.JDLeft: isReleased = !IsGamepadKeyLeftPressed(); break;
             case MyJoystickButtonsEnum.JDRight: isReleased = !IsGamepadKeyRightPressed(); break;
             case MyJoystickButtonsEnum.JDUp: isReleased = !IsGamepadKeyUpPressed(); break;
             case MyJoystickButtonsEnum.JDDown: isReleased = !IsGamepadKeyDownPressed(); break;
             default: isReleased = m_actualJoystickState.IsReleased((int)button - 5); break;
         }
     }
     if (!isReleased && button == MyJoystickButtonsEnum.None)
     {
         return true;
     }
     return isReleased;
 }
开发者ID:stanhebben,项目名称:SpaceEngineers,代码行数:20,代码来源:MyDirectXInput.cs



注:本文中的MyJoystickButtonsEnum类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# MyKeys类代码示例发布时间:2022-05-24
下一篇:
C# MyJoystickAxesEnum类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap