elvissteinjr / DesktopPlus

Advanced desktop access for OpenVR
GNU General Public License v3.0
454 stars 29 forks source link

Feature request: ability to bind a controller key to toggle the visibility of an overlay #34

Closed matejdro closed 2 years ago

matejdro commented 2 years ago

With NewUI Preview 3, using desktop overlay is actually nicer outside of the dashboard rather than inside, thanks to the multi-pointer keyboard.

Unfortunately, there is no good way to toggle the overlay if I want to just quickly check something on my desktop while in-game. With in-dashboard overlays I could just press steam button on the controller and overlay would toggle. But with in-game overlay, I have to open steam dashboard first, manually show the dashboard and then close the dashboard. Then repeat that to hide.

Not sure if steam API allows that, but could we bind a key that is usually not used in games (maybe holding menu button or even holding the steam button) to toggle desktop overlay?

elvissteinjr commented 2 years ago

The main branch of Desktop+ already has this functionality, so it's definitely returning in some form in future builds.

And while there's no new UI for it yet (and I'll probably change a few things up later), this should still work when configured by hand. If you want to do that, edit config.ini while Desktop+ isn't running and change "GroupID=0" for the respective overlays (0 - 3 are valid values), then bind one of the "Toggle Overlay Group X Enabled State" as a global shortcut in the SteamVR input bindings for Desktop+.

I've also been playing with the thought of allowing to toggle the Desktop+ dashboard interface (dashboard/desktop+ tab origin overlays + Overlay Bar) to be brought up by a global shortcut as well. Might be desirable.

matejdro commented 2 years ago

as a global shortcut

Any more tips on how can I set it as global shortcut? I managed to set the bindings for Desktop+, but they do not react, presumably because they are not set as global and game takes precedence.

elvissteinjr commented 2 years ago

Global shortcuts should be working from the bindings. You need to make sure not to have the Desktop+ laser pointer active when using an input that is also used there, as the laser pointer bindings take priority. Dashboard also has to be closed. Game input and global shortcuts should work at the same time and not interfere with each other.

Make sure you've assigned the overlay group correctly since the default is 0 which doesn't have any input action. The "Do Global Shortcut X" input actions won't do anything unless you assigned an Action to them (configurable in the old Action Editor UI). I also just realized it might a bit misleading as the binding category and the input actions to trigger Desktop+ Actions are both "Global Shortcuts". For overlay toggling just use "Toggle Overlay Group X Enabled State" as I said in the previous post.

Also something to keep in mind is that Desktop+ refreshes input state at a lower rate than the headset's refresh rate (unless an active desktop mirror updates more often). Very quick inputs can get lost at times, so you could try holding the input down a little longer if it doesn't toggle.

And lastly... the SteamVR Controller binding interface can also be a pain and not actually update sometimes or just freeze. Something to watch out for.

Still looking to smooth it out later on. For now this is still possible, but technically unsupported territory for the NewUI branch.

matejdro commented 2 years ago

Found the issue, I was editing config.ini instead of config_newui.ini

It works great now, thanks!