Page 1 of 2

boipushy (Input handling)

Posted: Thu Jan 15, 2015 11:26 pm
by adnzzzzZ
Hi. I've created a library for handling and abstracting away some things about input with LÖVE. It should make it easier to use gamepads, to bind/unbind keys to game actions, and to check for pressed/released calls inside the update loop instead of on callbacks.

boipushy

Re: Thomas

Posted: Fri Jan 16, 2015 12:29 am
by master both
So clean and easy! Nice library, I will sure use it for my projects.

Re: [Library] Thomas

Posted: Fri Jan 16, 2015 7:45 am
by Roland_Yonaba
Nice work! Shared on my Twitter :)
Well, I do like the name, also. can you explain how come you named it this way ? :awesome:

Re: [Library] Thomas

Posted: Fri Jul 17, 2015 12:56 am
by adnzzzzZ
Updated this with the following:
  • Exposed Input.all_keys variable
  • Fixed a bug with space not being able to be bound accordingly in some situations
  • Added automatic callback registers (meaning you don't need to add each input object to all love callbacks anymore, it does that automatically)
  • Added support for 0.10.0 (but it also still works on >=0.9.1)
https://github.com/adonaac/thomas

Re: [Library] boipushy (Input handling)

Posted: Fri Sep 18, 2015 8:32 am
by adnzzzzZ
Updated this with the following:
  • Changed the name to boipushy
  • Made updating implicit, meaning all that has to be done to use an Input object is creating it
https://github.com/adonaac/boipushy

Re: [Library] boipushy (Input handling)

Posted: Sat Sep 19, 2015 12:39 pm
by T-Bone
I don't really understand how the bind function works. I guess you can bind buttons to both strings and functions? If you bind to a function, when will it be called (pressed, down and/or up)?

Re: [Library] boipushy (Input handling)

Posted: Sat Sep 19, 2015 9:04 pm
by adnzzzzZ
Yes. The string you bind it to is an action, such as 'Jump' or 'MoveRight'. This is so you can change key bindings without having to change everywhere that action is triggered (i.e. in code you write if input:pressed('Jump') and if you change the bindings to jump you don't have to go to that if and change it). As for the function, it's just an easy way to get some functionality tied to a key so you don't have to do the check on an update function. And it gets called when the key is pressed.

Re: [Library] boipushy (Input handling)

Posted: Sun Sep 20, 2015 6:41 am
by T-Bone
How good is it at understanding different gamepads on different platforms? Can I rely on this working well regardless of what OS and what gamepad the player is using?

Re: [Library] boipushy (Input handling)

Posted: Sun Sep 20, 2015 8:15 am
by adnzzzzZ
It's as good as LÖVE is by default (which is as good as SDL is). So far I haven't tested a multitude of controllers but the one I have (DS3) works normally without any setup.

Re: [Library] boipushy (Input handling)

Posted: Thu Sep 24, 2015 5:48 am
by Skeiks
I've been using this library in one of my projects and recently updated it to the new version. The newest version seems to break something in the call backs to the 'keypressed' method, causing Input:pressed() to be called twice, which breaks keypressed events about 90% of the time.

This could be related to how I handle frames (static timestep with an accumulator) or something, but the bindings were a bit above my lua skill level at the moment so I just rolled back to the last version. If I can figure out exactly what's going on I'll try to submit an update.

The library is really slick though. You handled input abstraction very smoothly.