问题描述
我想知道我应该如何处理针对 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:
来自 MSDN,好像只支持Xbox 360手柄
From MSDN, it only seems to support Xbox 360 controllers
XInput 是一种 API,它允许应用程序从 Windows Xbox 360 控制器接收输入.支持控制器隆隆声效果和语音输入输出.
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 的控制器支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!