Out of focus Gamepad hook

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
alejandroalzate
Citizen
Posts: 67
Joined: Sat May 08, 2021 9:45 pm

Out of focus Gamepad hook

Post 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?)

Code: Select all

target = boardIndex.getWhosPeekingThisLine()
target:setObey(true)
User avatar
zorg
Party member
Posts: 3436
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Out of focus Gamepad hook

Post by zorg »

I believe that gamepad should already work even if the game is unfocused, but keyboard and mouse won't.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
User avatar
BrotSagtMist
Party member
Posts: 607
Joined: Fri Aug 06, 2021 10:30 pm

Re: Out of focus Gamepad hook

Post 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
obey
Post Reply

Who is online

Users browsing this forum: No registered users and 46 guests