当前位置: 首页>>代码示例>>C#>>正文


C# Input.AddAxisMapping方法代码示例

本文整理汇总了C#中Input.AddAxisMapping方法的典型用法代码示例。如果您正苦于以下问题:C# Input.AddAxisMapping方法的具体用法?C# Input.AddAxisMapping怎么用?C# Input.AddAxisMapping使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Input的用法示例。


在下文中一共展示了Input.AddAxisMapping方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetupControls

    public static void SetupControls( Input input )
    {
        #if WINDOWS
        input.AddButtonMapping((int)E_UiButton.D1, E_Device.Keyboard, (int)Keys.D1);
        input.AddButtonMapping((int)E_UiButton.D2, E_Device.Keyboard, (int)Keys.D2);
        input.AddButtonMapping((int)E_UiButton.D3, E_Device.Keyboard, (int)Keys.D3);
        input.AddButtonMapping((int)E_UiButton.D4, E_Device.Keyboard, (int)Keys.D4);
        input.AddButtonMapping((int)E_UiButton.D5, E_Device.Keyboard, (int)Keys.D5);
        input.AddButtonMapping((int)E_UiButton.D6, E_Device.Keyboard, (int)Keys.D6);
        input.AddButtonMapping((int)E_UiButton.D7, E_Device.Keyboard, (int)Keys.D7);
        input.AddButtonMapping((int)E_UiButton.D8, E_Device.Keyboard, (int)Keys.D8);
        input.AddButtonMapping((int)E_UiButton.D9, E_Device.Keyboard, (int)Keys.D9);
        input.AddButtonMapping((int)E_UiButton.D0, E_Device.Keyboard, (int)Keys.D0);

        input.AddButtonMapping((int)E_UiButton.D1, E_Device.Keyboard, (int)Keys.D1);
        input.AddButtonMapping((int)E_UiButton.Space, E_Device.Keyboard, (int)Keys.Space);
        for (int i = (int)E_UiButton.A; i <= (int)E_UiButton.Z;i++ )
        {
            input.AddButtonMapping(i, E_Device.Keyboard, (int)Keys.A + (i - (int)E_UiButton.A));
        }

        input.AddButtonMapping( (int)E_UiButton.Quit, E_Device.Keyboard, (int)Keys.Escape );
        input.AddButtonMapping( (int)E_UiButton.Up, E_Device.Keyboard, (int)Keys.Up );
        input.AddButtonMapping( (int)E_UiButton.Down, E_Device.Keyboard, (int)Keys.Down );
        input.AddButtonMapping( (int)E_UiButton.Left, E_Device.Keyboard, (int)Keys.Left );
        input.AddButtonMapping( (int)E_UiButton.Right, E_Device.Keyboard, (int)Keys.Right );
        input.AddButtonMapping( (int)E_UiButton.Enter, E_Device.Keyboard, (int)Keys.Enter );
        input.AddButtonMapping( (int)E_UiButton.Back, E_Device.Keyboard, (int)Keys.Back );

        input.AddButtonMapping( (int)E_UiButton.MouseLeft, E_Device.Mouse, (int)E_MouseButton.Left );
        input.AddButtonMapping( (int)E_UiButton.MouseRight, E_Device.Mouse, (int)E_MouseButton.Right );
        #endif

        #if !RELEASE
        input.AddButtonMapping( (int)E_UiButton.Quit, E_Device.Controller, (int)E_Button.RightStick );
        #endif

        input.AddButtonMapping( (int)E_UiButton.Up, E_Device.Controller, (int)E_Button.LeftStickUp );
        input.AddButtonMapping( (int)E_UiButton.Up, E_Device.Controller, (int)E_Button.DPadUp );
        input.AddButtonMapping( (int)E_UiButton.Down, E_Device.Controller, (int)E_Button.LeftStickDown );
        input.AddButtonMapping( (int)E_UiButton.Down, E_Device.Controller, (int)E_Button.DPadDown );
        input.AddButtonMapping( (int)E_UiButton.Left, E_Device.Controller, (int)E_Button.LeftStickLeft );
        input.AddButtonMapping( (int)E_UiButton.Left, E_Device.Controller, (int)E_Button.DPadLeft );
        input.AddButtonMapping( (int)E_UiButton.Right, E_Device.Controller, (int)E_Button.LeftStickRight );
        input.AddButtonMapping( (int)E_UiButton.Right, E_Device.Controller, (int)E_Button.DPadRight );
        input.AddButtonMapping( (int)E_UiButton.A, E_Device.Controller, (int)E_Button.A );
        input.AddButtonMapping( (int)E_UiButton.B, E_Device.Controller, (int)E_Button.B );
        input.AddButtonMapping( (int)E_UiButton.X, E_Device.Controller, (int)E_Button.X );
        input.AddButtonMapping( (int)E_UiButton.Y, E_Device.Controller, (int)E_Button.Y );
        input.AddButtonMapping( (int)E_UiButton.Start, E_Device.Controller, (int)E_Button.Start );
        input.AddButtonMapping( (int)E_UiButton.Back, E_Device.Controller, (int)E_Button.Back );
        input.AddButtonMapping( (int)E_UiButton.LeftTrigger, E_Device.Controller, (int)E_Button.LeftTrigger );
        input.AddButtonMapping( (int)E_UiButton.RightTrigger, E_Device.Controller, (int)E_Button.RightTrigger );
        input.AddButtonMapping( (int)E_UiButton.LeftShoulder, E_Device.Controller, (int)E_Button.LeftShoulder );
        input.AddButtonMapping( (int)E_UiButton.RightShoulder, E_Device.Controller, (int)E_Button.RightShoulder );
        input.AddButtonMapping( (int)E_UiButton.LeftStick, E_Device.Controller, (int)E_Button.LeftStick );
        input.AddButtonMapping( (int)E_UiButton.RightStick, E_Device.Controller, (int)E_Button.RightStick );
        input.AddButtonMapping( (int)E_UiButton.DPadUp, E_Device.Controller, (int)E_Button.DPadUp );
        input.AddButtonMapping( (int)E_UiButton.DPadDown, E_Device.Controller, (int)E_Button.DPadDown );
        input.AddButtonMapping( (int)E_UiButton.DPadLeft, E_Device.Controller, (int)E_Button.DPadLeft );
        input.AddButtonMapping( (int)E_UiButton.DPadRight, E_Device.Controller, (int)E_Button.DPadRight );

        input.AddAxisMapping( (int)E_UiAxis.LeftStickX, E_Device.Controller, (int)E_Button.LeftStickLeft, (int)E_Button.LeftStickRight );
        input.AddAxisMapping( (int)E_UiAxis.LeftStickY, E_Device.Controller, (int)E_Button.LeftStickDown, (int)E_Button.LeftStickUp );
        input.AddAxisMapping( (int)E_UiAxis.RightStickX, E_Device.Controller, (int)E_Button.RightStickLeft, (int)E_Button.RightStickRight );
        input.AddAxisMapping( (int)E_UiAxis.RightStickY, E_Device.Controller, (int)E_Button.RightStickDown, (int)E_Button.RightStickUp );
    }
开发者ID:tuannsofta,项目名称:kinect4bag,代码行数:67,代码来源:Globals.cs

示例2: SetupControls

    public static void SetupControls( Input input )
    {
        #if WINDOWS
        input.AddButtonMapping( (int)E_UiButton.Quit, E_Device.Keyboard, (int)Keys.Escape );
        input.AddButtonMapping( (int)E_UiButton.Up, E_Device.Keyboard, (int)Keys.Up );
        input.AddButtonMapping( (int)E_UiButton.Down, E_Device.Keyboard, (int)Keys.Down );
        input.AddButtonMapping( (int)E_UiButton.Left, E_Device.Keyboard, (int)Keys.Left );
        input.AddButtonMapping( (int)E_UiButton.Right, E_Device.Keyboard, (int)Keys.Right );
        input.AddButtonMapping( (int)E_UiButton.A, E_Device.Keyboard, (int)Keys.Enter );
        input.AddButtonMapping( (int)E_UiButton.B, E_Device.Keyboard, (int)Keys.Back );

        input.AddButtonMapping( (int)E_UiButton.MouseLeft, E_Device.Mouse, (int)E_MouseButton.Left );
        input.AddButtonMapping( (int)E_UiButton.MouseRight, E_Device.Mouse, (int)E_MouseButton.Right );
        #endif

        #if !RELEASE
        input.AddButtonMapping( (int)E_UiButton.Quit, E_Device.Controller, (int)E_Button.RightStick );
        #endif

        input.AddButtonMapping( (int)E_UiButton.Up, E_Device.Controller, (int)E_Button.LeftStickUp );
        input.AddButtonMapping( (int)E_UiButton.Up, E_Device.Controller, (int)E_Button.DPadUp );
        input.AddButtonMapping( (int)E_UiButton.Down, E_Device.Controller, (int)E_Button.LeftStickDown );
        input.AddButtonMapping( (int)E_UiButton.Down, E_Device.Controller, (int)E_Button.DPadDown );
        input.AddButtonMapping( (int)E_UiButton.Left, E_Device.Controller, (int)E_Button.LeftStickLeft );
        input.AddButtonMapping( (int)E_UiButton.Left, E_Device.Controller, (int)E_Button.DPadLeft );
        input.AddButtonMapping( (int)E_UiButton.Right, E_Device.Controller, (int)E_Button.LeftStickRight );
        input.AddButtonMapping( (int)E_UiButton.Right, E_Device.Controller, (int)E_Button.DPadRight );
        input.AddButtonMapping( (int)E_UiButton.A, E_Device.Controller, (int)E_Button.A );
        input.AddButtonMapping( (int)E_UiButton.B, E_Device.Controller, (int)E_Button.B );
        input.AddButtonMapping( (int)E_UiButton.X, E_Device.Controller, (int)E_Button.X );
        input.AddButtonMapping( (int)E_UiButton.Y, E_Device.Controller, (int)E_Button.Y );
        input.AddButtonMapping( (int)E_UiButton.Start, E_Device.Controller, (int)E_Button.Start );
        input.AddButtonMapping( (int)E_UiButton.Back, E_Device.Controller, (int)E_Button.Back );
        input.AddButtonMapping( (int)E_UiButton.LeftTrigger, E_Device.Controller, (int)E_Button.LeftTrigger );
        input.AddButtonMapping( (int)E_UiButton.RightTrigger, E_Device.Controller, (int)E_Button.RightTrigger );
        input.AddButtonMapping( (int)E_UiButton.LeftShoulder, E_Device.Controller, (int)E_Button.LeftShoulder );
        input.AddButtonMapping( (int)E_UiButton.RightShoulder, E_Device.Controller, (int)E_Button.RightShoulder );
        input.AddButtonMapping( (int)E_UiButton.LeftStick, E_Device.Controller, (int)E_Button.LeftStick );
        input.AddButtonMapping( (int)E_UiButton.RightStick, E_Device.Controller, (int)E_Button.RightStick );
        input.AddButtonMapping( (int)E_UiButton.DPadUp, E_Device.Controller, (int)E_Button.DPadUp );
        input.AddButtonMapping( (int)E_UiButton.DPadDown, E_Device.Controller, (int)E_Button.DPadDown );
        input.AddButtonMapping( (int)E_UiButton.DPadLeft, E_Device.Controller, (int)E_Button.DPadLeft );
        input.AddButtonMapping( (int)E_UiButton.DPadRight, E_Device.Controller, (int)E_Button.DPadRight );

        input.AddAxisMapping( (int)E_UiAxis.LeftStickX, E_Device.Controller, (int)E_Button.LeftStickLeft, (int)E_Button.LeftStickRight );
        input.AddAxisMapping( (int)E_UiAxis.LeftStickY, E_Device.Controller, (int)E_Button.LeftStickDown, (int)E_Button.LeftStickUp );
        input.AddAxisMapping( (int)E_UiAxis.RightStickX, E_Device.Controller, (int)E_Button.RightStickLeft, (int)E_Button.RightStickRight );
        input.AddAxisMapping( (int)E_UiAxis.RightStickY, E_Device.Controller, (int)E_Button.RightStickDown, (int)E_Button.RightStickUp );
    }
开发者ID:jtavandenheuvel,项目名称:pcg-decoration-new,代码行数:49,代码来源:Globals.cs


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