project-gameface icon indicating copy to clipboard operation
project-gameface copied to clipboard

pydirectinput -> pyautogui ?

Open willwade opened this issue 1 year ago • 3 comments

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??)

willwade avatar May 13 '23 21:05 willwade

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 avatar Jun 16 '23 05:06 avneetgoogle

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

avneetgoogle avatar Jun 16 '23 05:06 avneetgoogle

@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

willwade avatar Jun 17 '23 14:06 willwade