View Single Post
Old 03-12-21, 11:58 PM   #16
themrwho
Torpedoman
 
Join Date: Jul 2010
Posts: 119
Downloads: 140
Uploads: 0


Default

Script linked below is a workaround for now: it does not fix the core issue, and I am still after a better solution but until then, hopefully this will do.
Tested this only for an hour, more testing is needed but initial results are good.
Script just makes it easier (via AutoHotkey automation) to re-activate sh4 window without doing anything or clicking anything -- works simply by "waiting".
Script URL: https://gitlab.com/themrwho/focus-sh4

Script has three settings:
0=off
1=slight effort (activate sh4 window after 5s inactivity)
2=focused effort (activate sh4 window after 0.25s inactivity)

A global desktop shortcut (SHIFT+F2) changes toggles the setting (increments it by 1, after max value 2, another hit takes it to level 0).
Human voice (mp3) announces the new setting level as feedback.

With quick testing, I found the default and aggressive setting 2 -which is best for having maximum amount sh4 audio- difficult to use for doing anything more than a single click in the "other window".
However it works great for its intended purpose: if you're watching stuff on YouTube and also playing sh4 on the other screen (more like idling/patrolling, waiting for a contact etc.) you can click to a different point in time in the video, then you will get your sh4 audio back almost instantly.

When script activates sh4 window, what happens to the other-window?
The other-window (let's say web browser) stays mouse-wheel-controllable and as long as your mouse pointer is only hovering over on that other screen (i.e.: if you do NOT click into that other-window) you can keep mouse wheel controlling it forever, it will not deactivate sh4 window and thus will not lose sh4 audio.

Practical example: if you are on a forums thread, you can mouse wheel up/down, keep scrolling up/down and read the whole thing.
You could do all that without this script anyway.
With this script in its aggressive default setting (level 2) you can even click on the NEXT PAGE button then the script, in quarter of a second, will re-activate sh4 window for you and you'll regain audio without lifting a finger.
Effortless automation, combined with an adequate delay seems to be working well in the sense that I can now both browse/read forums and webpages, watch YouTube and also not lose sh4 audio which is what I wanted in the first place.

What I still cannot do is use the keyboard, for example while typing this message I have had to set the script to setting 0 (automation turned off) otherwise it would keep reactivating sh4 window when I don't want it to.
That's why I am still after a better solution, if I find one I will share that too. Meanwhile always happy for any more tips/assistance.

Just to be clear to benefit from this script, you need a dual (or better) screen setup and (probably) need to be running sh4 with (almost)-fullscreen-borderless mode, using the 1-pixel-less hack described in post #14 in this thread. Only after that you can freely move your mouse in the other screen without losing sh4 audio.
themrwho is offline   Reply With Quote