Is it possible to make a window believe that it has a focus while it has not?
My use case description: I am playing a game named Detroit Become Human. I am playing with gamepad. The game is actually an interactive movie. It has a very complicated flowcharts. I want to see other scenes that I missed after my original walkthrough. I am reading the walkthrough guide in a browser and switching to game very often and want to see flowchart in a game. Because the flowcharts are very complicated, I need to keep lots of tabs in browser, constantly scroll pages up and down trying to read descriptions for some nodes. And I get really annoyed that I constantly need to refocus a game itself to be able to control it (even with gamepad) and press alt+tab to release mouse from the game. Also, the game makes me rewatching lots of scenes that I already have seen and I want to do some other readings while such scenes are playing. Also, there are scenes with minor interactions, but still I need to focus a game window for them.
I wanted to make it easier. I want the game to be controllable by gamepad while its window not in focus. I thought that I need to capture a gamepad input and redirect it to inactive window. And that thing was what I wanted originally to ask. However, I have noticed, that chromium while not in focus is still able to see the gamepad input by using this web site: https://gamepad-tester.com/. This means (as I think) that all windows have access to the gamepad input.
Now I think that the problem is the game itself. I think it checks if it is in focus, and if not, it do not interprets the input.
I want the game to always interpret gamepad, even when missing focus. Is that possible?
My system details:
Arch Linux.
Game launched via steam.
Tried with Steam Input and without it.
KDE Plasma.
Logitech F710 Gamepad in XInput mode.
The game launched in borderless window mode, also tried fullscreen and windowed.
Additional info.
This trick may be useful not only for games (which often pauses when not in focus), but also for applications. For example, DaVinci Resolve hides a window with effects parameters. I am watching a tutorial video on youtube in browser. When I focus a browser, I cannot see my parameters window to compare it with such on a youtube.
Tricking the DaVinci Resolve that it has focus (while still disabling keyboard input for it) may solve this.