Baton - yet another input library

Showcase your libraries, tools and other projects that help your fellow love users.
pevzi
Prole
Posts: 27
Joined: Tue Apr 02, 2013 4:09 pm
Contact:

Re: Baton - yet another input library

Post 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. :oops:
User avatar
Tesselode
Party member
Posts: 555
Joined: Fri Jul 23, 2010 7:55 pm

Re: Baton - yet another input library

Post 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. :oops:
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.
User avatar
D0NM
Party member
Posts: 250
Joined: Mon Feb 08, 2016 10:35 am
Location: Zabuyaki
Contact:

Re: Baton - yet another input library

Post 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...
Our LÖVE Gamedev blog Zabuyaki (an open source retro beat 'em up game). Twitter: @Zabuyaki.
:joker: LÖVE & Lua Video Lessons in Russian / Видео уроки по LÖVE и Lua :joker:
User avatar
Tesselode
Party member
Posts: 555
Joined: Fri Jul 23, 2010 7:55 pm

Re: Baton - yet another input library

Post 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.
User avatar
D0NM
Party member
Posts: 250
Joined: Mon Feb 08, 2016 10:35 am
Location: Zabuyaki
Contact:

Re: Baton - yet another input library

Post 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 :o )), n1 n2<-3

So the in-game controls are messed. :3

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.
Our LÖVE Gamedev blog Zabuyaki (an open source retro beat 'em up game). Twitter: @Zabuyaki.
:joker: LÖVE & Lua Video Lessons in Russian / Видео уроки по LÖVE и Lua :joker:
User avatar
Tesselode
Party member
Posts: 555
Joined: Fri Jul 23, 2010 7:55 pm

Re: Baton - yet another input library

Post 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 :o )), n1 n2<-3

So the in-game controls are messed. :3

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.
User avatar
zorg
Party member
Posts: 3436
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Baton - yet another input library

Post 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.
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
D0NM
Party member
Posts: 250
Joined: Mon Feb 08, 2016 10:35 am
Location: Zabuyaki
Contact:

Re: Baton - yet another input library

Post by D0NM »

Guys, thank u.
I have to re-check it. I had some effect of "switching" joysticks some time ago.
Our LÖVE Gamedev blog Zabuyaki (an open source retro beat 'em up game). Twitter: @Zabuyaki.
:joker: LÖVE & Lua Video Lessons in Russian / Видео уроки по LÖVE и Lua :joker:
User avatar
Tesselode
Party member
Posts: 555
Joined: Fri Jul 23, 2010 7:55 pm

Re: Baton - yet another input library

Post 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?
User avatar
zorg
Party member
Posts: 3436
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Baton - yet another input library

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

Who is online

Users browsing this forum: No registered users and 49 guests