Page 2 of 3
Re: Baton - yet another input library
Posted: Mon Oct 24, 2016 10:34 am
by pevzi
Tesselode wrote:Or, if you see a way to make it more efficient, feel free to make a PR.
Wow, it turned out harder than I had imagined. Every solution I've managed to come up with suffers from subtle yet unacceptable problems. If I ever think of a reasonable way to change this I'll let you know. Sorry for bothering you.
Re: Baton - yet another input library
Posted: Mon Oct 24, 2016 2:13 pm
by Tesselode
pevzi wrote:Tesselode wrote:Or, if you see a way to make it more efficient, feel free to make a PR.
Wow, it turned out harder than I had imagined. Every solution I've managed to come up with suffers from subtle yet unacceptable problems. If I ever think of a reasonable way to change this I'll let you know. Sorry for bothering you.
Heh, yeah, I've gone through my fair share of subtle problems with each iteration. You're not bothering me, though, and thanks for exploring different possibilities for me! Feel free to offer feedback at any time.
Re: Baton - yet another input library
Posted: Mon Oct 24, 2016 3:43 pm
by D0NM
Tesselode, thank you.
I just got used to Tactile
)) had to add some stuff in tho.
Baton looks nice. Gotta try it ))
I'm looking forward to a cool & simple INPUT REDEFINE screen for several devices...
Re: Baton - yet another input library
Posted: Mon Oct 24, 2016 9:33 pm
by Tesselode
D0NM wrote:Tesselode, thank you.
I just got used to Tactile
)) had to add some stuff in tho.
Baton looks nice. Gotta try it ))
I'm looking forward to a cool & simple INPUT REDEFINE screen for several devices...
I'm thinking of making an "input watcher" library to compliment Tactile; it would definitely make control setup menus easier.
Re: Baton - yet another input library
Posted: Tue Oct 25, 2016 4:56 am
by D0NM
Tesselode wrote:
I'm thinking of making an "input watcher" library to compliment Tactile; it would definitely make control setup menus easier.
Let me throw in a situation:
e.g we have 4 players keyboard / 3 different gamepads. n1 n2 n3
We play a game then player 2 plugs out his spiffy gamepad n2 and goes home.
What do we have there? The unplugging event is called. The gamepads numbers
are shifted -> keyboard(ouch! you can plug out it too
)), n1 n2<-3
So the in-game controls are messed.
PS when I turn off my bluetooth gamepads or switch off the PC bluetooth
the joystick_unplugged event might not work. I did test some months ago for LOVE 0.10.1
I cannot remember the exact results.
Re: Baton - yet another input library
Posted: Tue Oct 25, 2016 6:50 pm
by Tesselode
D0NM wrote:Tesselode wrote:
I'm thinking of making an "input watcher" library to compliment Tactile; it would definitely make control setup menus easier.
Let me throw in a situation:
e.g we have 4 players keyboard / 3 different gamepads. n1 n2 n3
We play a game then player 2 plugs out his spiffy gamepad n2 and goes home.
What do we have there? The unplugging event is called. The gamepads numbers
are shifted -> keyboard(ouch! you can plug out it too
)), n1 n2<-3
So the in-game controls are messed.
PS when I turn off my bluetooth gamepads or switch off the PC bluetooth
the joystick_unplugged event might not work. I did test some months ago for LOVE 0.10.1
I cannot remember the exact results.
Please let me know if I'm wrong, but I believe that once you store a love Joystick to a variable, it will keep referring to the same controller until you unplug it, and you don't have to worry about any numbers shifting. Baton uses Joystick objects to keep track of each player's controller, not a number.
Re: Baton - yet another input library
Posted: Tue Oct 25, 2016 11:25 pm
by zorg
Tesselode wrote:Please let me know if I'm wrong, but I believe that once you store a love Joystick to a variable, it will keep referring to the same controller until you unplug it, and you don't have to worry about any numbers shifting. Baton uses Joystick objects to keep track of each player's controller, not a number.
Actually, if you don't close Löve, even if you unplug a controller, then re-plug it, it will still have the same ID. See
here.
Re: Baton - yet another input library
Posted: Wed Oct 26, 2016 11:17 am
by D0NM
Guys, thank u.
I have to re-check it. I had some effect of "switching" joysticks some time ago.
Re: Baton - yet another input library
Posted: Wed Oct 26, 2016 3:06 pm
by Tesselode
zorg wrote:Tesselode wrote:Please let me know if I'm wrong, but I believe that once you store a love Joystick to a variable, it will keep referring to the same controller until you unplug it, and you don't have to worry about any numbers shifting. Baton uses Joystick objects to keep track of each player's controller, not a number.
Actually, if you don't close Löve, even if you unplug a controller, then re-plug it, it will still have the same ID. See
here.
Do you know if the order of the joysticks table returned from love.joystick.getJoysticks() is predetermined?
Re: Baton - yet another input library
Posted: Wed Oct 26, 2016 3:31 pm
by zorg
Tesselode wrote:zorg wrote:Tesselode wrote:Please let me know if I'm wrong, but I believe that once you store a love Joystick to a variable, it will keep referring to the same controller until you unplug it, and you don't have to worry about any numbers shifting. Baton uses Joystick objects to keep track of each player's controller, not a number.
Actually, if you don't close Löve, even if you unplug a controller, then re-plug it, it will still have the same ID. See
here.
Do you know if the order of the joysticks table returned from love.joystick.getJoysticks() is predetermined?
Sadly no, but you can go over them, and check their id-s, and store them by id in another table, for example.