Thank you for your reply
I'm not a programmer so I might be writing something irrelevant
First of all reading other people's posts I noticed a mistake
It's SDL input, not direct input
DuckStation of PlayStation emulator can select input backend from direct input, X input, SDL
Any backend accepts controller input for non-focus windows
It may be limited to Windows, but there seems to be a way
DuckStation
https://github.com/stenzek/duckstationIn SDL, if you use "SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS", it seems that you can input the controller even in the non-focus window.
SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS
https://wiki.libsdl.org/SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTSIt seems that direct input can be input to the controller in the non-focus window as well as X input.
Or there seems to be a method such as "Set Cooperative Level Method"
DirectInput Wikipedia
https://en.wikipedia.org/wiki/DirectInputSetCooperativeLevel Method
https://docs.microsoft.com/ja-jp/previous-versions/windows/desktop/ee417921(v=vs.85)Google Translation