JPersson77 / LGTVCompanion

Power On and Off WebOS LG TVs together with your PC
MIT License
950 stars 40 forks source link

Idle detection no longer working for controller through Steam #160

Open laurinius opened 1 year ago

laurinius commented 1 year ago

For some reason the idle detection does not work correctly anymore when using the inbuilt controller support from Steam. It worked in the past, but no longer, the screen goes to idle even though I'm actively using the controller. Might be related to how Steam implements its controller support (seems like somehow disabling the original game device and creating a device layer hidden from Windows), but it used to work fine before. Other games not using Steam also work ok. I'm using a PS5 Dual Sense through Bluetooth (same setup as before).

JPersson77 commented 1 year ago

Hi @laurinius is it steam big picture then? Can you verify the behaviour observed by launching c:/program files/lgtv companion/LGTV daemon -show please. This should show the status window for the daemon. In the bottom is timer for the idle detection. See if you can draw some conclusions on how the idle timer is affected.

Is there any setting in steam that may possible to toggle which may affect the issue?

laurinius commented 1 year ago

Normal Steam UI, not using big picture mode.

I see that once Steam takes control of the controller the input is no longer registered through the GetLastInputInfo Windows API.

My current assumption is that Steam (and newer games) are using a different API to connect to the PS5 DualSense. When I disable the Playstation controller support in Steam it works, also tested with an old Xbox controller, where I also don't have that problem. That is as long as the game itself does not take this kind of native control, which some newer games seem to do.

I think Steam and newer games might use some different API to use functions of the DualSense that are not available when accessing it as HID device or something like that.

It is weird though that it did work at least some weeks ago, where Steam also already had support for the DualSense...

JPersson77 commented 11 months ago

Hi again @laurinius

I've been looking into steam input a bit and it is as you write. It is a (rather clever) API that game developers can implement to easily add controller support to their game. Since it is an affair between steam and the game developer GetLastInputInfo isn't triggered as you've noticed. Not sure how to overcome without catching raw input, but that has its own problems, for example triggering anti-virus warnings since the behaviour then iwould be similar to a keylogger. So I have not figured out if it's possible but I will keep the issue open and treat it (support of steam input idle detection) as a feature request as it would be great to be able to have it implemented

Btw, how well/normal does the regular windows screensaver, or windows powersaving (turn off monitor after x minutes) work in relation to steam input and user idle, on your system?