google / project-gameface

Apache License 2.0
588 stars 84 forks source link

pydirectinput -> pyautogui ? #9

Open willwade opened 1 year ago

willwade commented 1 year ago

I realise PyDirectInput is nice, but it makes it difficult to make it multiplatform. Is it possible to look at an alternative? pyautogui and some if statements to deal with Windows (and then use pydirectinput for Win only??)

avneetgoogle commented 1 year ago

Hey @willwade , thanks for checking in on this. To enable mouse and keyboard control within our Python application, we utilize two libraries: PyAutoGUI for mouse control and PyDirectInput for keyboard control. PyAutoGUI is chosen for its robust mouse control capabilities, allowing us to simulate mouse movements, clicks, and other actions. On the other hand, we leverage PyDirectInput for keyboard control as it offers enhanced compatibility with various applications, including games and those relying on DirectX.

You can read more about the technologies we leveraged and why here: https://developers.googleblog.com/2023/06/project-gameface.html

avneetgoogle commented 1 year ago

Let us know what you think, and we'd love to hear your feedback!

willwade commented 1 year ago

@avneetgoogle - I get that - but I'm sure I'm looking badly - I cant see lines in the code that really leverage directx which couldnt be done by pynput (NB: I think using pyAutoGui is causing some headaches https://github.com/google/project-gameface/issues/5#issuecomment-1571675474) - I'm sure I'm missing something. So if so to make this multplatform we just need to do some IF statements to have diff libraries