我能否使用Python实现无线Xbox 360 PC控制器的震动反馈?目前我只找到了读取输入信号的解决方案,但无法找到有关震动/反馈的信息。
编辑:
根据@AdamRosenfield提供的代码,我遇到了以下错误。
Traceback (most recent call last):
File "C:\Users\Usuario\Desktop\rumble.py", line 8, in <module>
xinput = ctypes.windll.Xinput # Load Xinput.dll
File "C:\Python27\lib\ctypes\__init__.py", line 435, in __getattr__
dll = self._dlltype(name)
File "C:\Python27\lib\ctypes\__init__.py", line 365, in __init__
self._handle = _dlopen(self._name, mode)
WindowsError: [Error 126] The specified module could not be found.
请注意,最后一个错误是从西班牙语翻译过来的。
ctypes.windll.xinput1_1
代替(或者xinput1_3
或XInput9_1_0
,或者无论您的C:\Windows\System32\xinput<version>.dll
的名称是什么)。 - Adam Rosenfield