Page 1 of 1

Out of focus Gamepad hook

Posted: Mon Jan 16, 2023 4:23 pm
by alejandroalzate
Hello i you wanted to ask someone knows how to make love to be able to get keyboard/gamepad input without focus?
My means to ask this is beacause i managed to make 2 player minecraft in one pc
the trick was that one instance had a mod called "Controllabe" that was able to pick up the gamepad while the
other instance was on focus using it with the good 'ol keyboard

My question is someone knows to replicate this effect on love (maybe gettin' dirty touching sdl or something?)

Re: Out of focus Gamepad hook

Posted: Mon Jan 16, 2023 5:08 pm
by zorg
I believe that gamepad should already work even if the game is unfocused, but keyboard and mouse won't.

Re: Out of focus Gamepad hook

Posted: Mon Jan 16, 2023 8:06 pm
by BrotSagtMist
No it wont work as default.
It can be turned on using two different methods for gamepad only.
This is one https://github.com/love2d/love/issues/970
The other is directly setting it as evironment variable so no code change is required:
export SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS=1