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.Tesselode wrote:Or, if you see a way to make it more efficient, feel free to make a PR.
Baton - yet another input library
Re: Baton - yet another input library
Re: Baton - yet another input library
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.pevzi wrote: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.Tesselode wrote:Or, if you see a way to make it more efficient, feel free to make a PR.
Re: Baton - yet another input library
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 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.
LÖVE & Lua Video Lessons in Russian / Видео уроки по LÖVE и Lua
LÖVE & Lua Video Lessons in Russian / Видео уроки по LÖVE и Lua
Re: Baton - yet another input library
I'm thinking of making an "input watcher" library to compliment Tactile; it would definitely make control setup menus easier.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...
Re: Baton - yet another input library
Let me throw in a situation:Tesselode wrote: I'm thinking of making an "input watcher" library to compliment Tactile; it would definitely make control setup menus easier.
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.
Our LÖVE Gamedev blog Zabuyaki (an open source retro beat 'em up game). Twitter: @Zabuyaki.
LÖVE & Lua Video Lessons in Russian / Видео уроки по LÖVE и Lua
LÖVE & Lua Video Lessons in Russian / Видео уроки по LÖVE и Lua
Re: Baton - yet another input library
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.D0NM wrote:Let me throw in a situation:Tesselode wrote: I'm thinking of making an "input watcher" library to compliment Tactile; it would definitely make control setup menus easier.
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.
- zorg
- Party member
- Posts: 3468
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Baton - yet another input library
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.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.
Me and my stuff True 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.
Re: Baton - yet another input library
Guys, thank u.
I have to re-check it. I had some effect of "switching" joysticks some time ago.
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.
LÖVE & Lua Video Lessons in Russian / Видео уроки по LÖVE и Lua
LÖVE & Lua Video Lessons in Russian / Видео уроки по LÖVE и Lua
Re: Baton - yet another input library
Do you know if the order of the joysticks table returned from love.joystick.getJoysticks() is predetermined?zorg wrote: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.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.
- zorg
- Party member
- Posts: 3468
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Baton - yet another input library
Sadly no, but you can go over them, and check their id-s, and store them by id in another table, for example.Tesselode wrote:Do you know if the order of the joysticks table returned from love.joystick.getJoysticks() is predetermined?zorg wrote: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.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.
Me and my stuff True 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.
Who is online
Users browsing this forum: No registered users and 6 guests