Zuzu-Typ / XInput-Python

Simple access to the DirectX input API for Python
zlib License
28 stars 5 forks source link

how to use as a Continuous movement?? #10

Closed mzalaki00 closed 1 year ago

mzalaki00 commented 1 year ago

Hi Thanks for your great work. when i use your lib for example elif event.type == EVENT_STICK_MOVED: if event.stick == RIGHT: print(event.x , event.y )

it seems the events are discrete not Continuous, i need to reported event.x and event.y very frequently when i hold STICK_MOVED any solution ??

Zuzu-Typ commented 1 year ago

Hi there (:

I'm not exactly sure I understand the issue you are having.

The function get_events() returns any changes in the controller state compared to the last time you called get_events(). Thus, if you want to get continuous updates, you need to call the method as frequently as required or you use the GamepadThread class.

mzalaki00 commented 1 year ago

i was looking for something like event.type == EVENT_STICK_Holded :) to know event.x and event.y every milisecond that gives Continuous flow of events but i find there is replacement --> your function get_thumb_values(state=get_state(0)) it solved my need. Thanks