In Short : any suggestion on how to listen to Xbox guide button ? or any suggestion on how to make "inputs" more optimized and faster for low-end PCs ?
hey. I had been looking for a way to make screenshots on windows easier. for now the only built-in function is win+prtsc , which is hard to press during a game when using a controller. I also happen to be good at programming, but i'm not familiar with input libraries on python...
so I used "pyautogui" library to simulate pressing win+prtSc , and used "pynput" library to listen to the button "/" on keyboard to do a screenshot ( well, a cheating screenshot. windows is taking screenshot and im just simulating the pressing of "win+prtSc" , so I named my script "screenshit" ).
so far so good.
it's not very hard to press "/" button for every screenshot. but to extend it, I wanted to use my controller to take the screenshot. but problem is pynput does not support gamepad controllers ! so I used another library called "inputs". this one does support a gamepad controller. however it uses at least 30% of CPU usage for working... which is BAD! here's the code to detect START ( the usual Map button ) with "inputs" library :
while 1:
events = get_gamepad()
if events:
print(events[0].code)
if events[0].code == 'START' :
ScreenShot()
I'm guessing 'get_gamepad()' is not optimized enough... but if im wrong or using it wrong, please guide me!
So , another thing that I would like to use would be the center/guide/xbox button. this button : xbox center button
but neither "inputs" nor "pynput" libraries seem to be listen to this button...
any suggestion on how to listen to this button ?
or
any suggestion on how to make "inputs" more optimized and faster for low-end PCs ?