So, I've taken a look at the Gosu source's Input.cpp to maybe fiddle with the gamepad implementation. I should add that this is the first time I see C-something, and after looking at it a little bit, I figured I'd need some more fiddling with the language before I can be of any help here... :) I do have afew ideas that would improve the class, though, in case anyone else would like to mess with it...
First of all, it'd be most awesome if you could directly return the value of SDL_JoystickGetAxis (
Documentation), as in a value between -32768 and 32767 (or even 0.0 to 1.0, really). It would/should be perfectly backwards compatible at least with Ruby (again, I don't know about C++), as "if (32767)" would still return true, but to be honest, I don't know about the negative values... maybe an additional parameter such as button_down?(id, :analog => true) would do the trick?
As for the dead zone, I'd personally like to have the option to not include it in the function, but in the method call, such as button_down?(id, :deadzone => 0.05) that defaults to some smart value... this would allow for a better fine-tuning, as well as giving the option to use user-input values, and read the base value if you want to know how big your joystick jitter is in the first place.
It'd also be practical to be able to directly reference the axes instead of just "up" or "down", for example. I've read somewhere before that to get the triggers on the X360 controller correctly without overwriting each other (as one of the triggers uses the x and the other the y output of the same "joystick"), you need to specifically read axis 8 and 9 to get the seperate values. Apparently this is the case for Windows drivers only, but nevertheless.
That being said, I could see a few methods being useful, for example something that translates the movement of x and y of a joystick into the combined value between the center and the outer ring (i'm sure there's a cool term for this in Math), basically to get the strangth it's being pressed with. Another thing would be the angle, while pretty straightforward, it would be a handy function to not having to code yourself.
I don't know if I'm being captain obvious here, and everyone knows the above and didn't just find the time to do it... but it seems like an easy-enough thing to do - I know I wouldn't take too long in Ruby to do it! :D