Windows UWP 中对 Xbox one 的控制器支持 [英] Controller support for Xbox one in Windows UWP

查看:24
本文介绍了Windows UWP 中对 Xbox one 的控制器支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道我应该如何处理针对 Xbox One 的 UWP 应用程序的输入.我已经注意到 DirectInput,但在我的用例中我发现它存在两个问题:

I am wondering how I am supposed to handle input for UWP apps targeting Xbox One. I have noticed DirectInput, but I see two issues with it for my use cases:

  1. 来自 MSDN,好像只支持Xbox 360手柄

  1. From MSDN, it only seems to support Xbox 360 controllers

XInput 是一种 API,它允许应用程序从 Windows Xbox 360 控制器接收输入.支持控制器隆隆声效果和语音输入输出.

XInput is an API that allows applications to receive input from the Xbox 360 Controller for Windows. Controller rumble effects and voice input and output are supported.

  • DirectX 及其所有 API(Direct2d、Direct3D、Xinput 等)仅在 C/C++ 上受支持.这意味着即使 Xinput 支持 Xbox one 控制器,我也无法使用 C# 或 JavaScript 来开发真正通用的应用程序.

  • DirectX and all of its API's (Direct2d, Direct3D, Xinput, etc...) are only supported on C / C++. That means even if Xinput supported Xbox one controllers, I could not use C# or JavaScript to develop truly universal apps.

    我有哪些选项(至少就 C# 而言)可以在 Windows UWP 应用上支持 Xbox One 控制器?

    What options do I have (at least as far as C# is concerned) for supporting Xbox One controller support on a Windows UWP app?

    推荐答案

    查看Windows.Gaming.Input 命名空间.它的 GamePad 类在通用 API 合同中,并且适用于所有设备系列和语言.

    Take a look at the Windows.Gaming.Input namespace. Its GamePad class is in the Universal API contract and available on all device families and languages.

    这篇关于Windows UWP 中对 Xbox one 的控制器支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆