如何在 WinForms 中使用 PlayStation 控制器

问题描述 投票:0回答:0

所以,我在 C# WinForms 中玩游戏,现在使用 XInputDotNetPure 设置 xbox 控制器没有严重问题。但现在我想对 PlayStation 控制器做同样的事情,但我遇到了一个大问题。我知道 PS 控制器需要来自 Steam 或 DS4 等软件的某种设置......但我的项目中需要相同的设置。

我尝试使用 SharpDX.DirectInput 和 SharpDX.XInput,但我什至无法识别控制器已连接。当蒸汽打开时,我的控制器工作正常,所以如果我需要一些驱动程序或其他东西,我会知道。我无法找到关于任何大型 API(如 SharpDX 或 DS4)的官方大型文档,所以如果你能找到一个,我可以在哪里知道使用什么语法等。请把它放在这里。我需要为他自己而不是每个试图玩我的游戏的人强制使用 DS4 或类似的东西来完成项目。感谢帮助

我的意思是它甚至没有识别控制器:

Controller controller = new Controller(UserIndex.One);

    if (controller.IsConnected)
        MessageBox.Show("PlayStation controller is connected.");
    else
        MessageBox.Show("PlayStation controller is not connected.");

    Controller controller1 = new Controller(UserIndex.Two);

    if (controller1.IsConnected)
        MessageBox.Show("PlayStation controller is connected.");
    else
        MessageBox.Show("PlayStation controller is not connected.");

    Controller controller2 = new Controller(UserIndex.Three);

    if (controller2.IsConnected)
        MessageBox.Show("PlayStation controller is connected.");
    else
        MessageBox.Show("PlayStation controller is not connected.");

    Controller controller3 = new Controller(UserIndex.Four);

    if (controller3.IsConnected)
        MessageBox.Show("PlayStation controller is connected.");
    else
        MessageBox.Show("PlayStation controller is not connected.");
c# winforms sharpdx playstation
© www.soinside.com 2019 - 2024. All rights reserved.