bayangan1991 / PYXInput

Python Library for Creating and Analysing XInput devices
https://pypi.python.org/pypi/PYXInput
MIT License
87 stars 22 forks source link

Input not recognizing? #12

Closed jae1379 closed 4 years ago

jae1379 commented 4 years ago

This might be a silly question.

pyxinput.test_virtual() works fine and I see the controlled being plugged in and disconnecting.

What command is the plug in controller 1 command?

When i just copy and paste

`import pyxinput

MyVirtual = pyxinput.vController()

MyRead = pyxinput.rController(1) # For Controller 1

MyVirtual.set_value('BtnA', 1)
MyVirtual.set_value('AxisLx', -0.5)

print(MyRead.gamepad)
print(MyRead.buttons)`

I hear plugging in sound but I no game controller is being recognized on the driver side. Thank you very much in advance

bayangan1991 commented 4 years ago

Hi @jae1379, the pyxinput.vController() is what "plugs in" the controller.

This block of code will only have the controller plugged in for less than a second as there is no long blocking call.

You may want to put a loop, or a long time.sleep() command at the end if you are trying to figure out the library.

jae1379 commented 4 years ago

Thank you very much! @bayangan1991