raidho36 wrote:josefnpat, this script is great, actually. I'm gonna borrow axis and buttons mapping from it to use by default for XBox360 mode in my lib.
EDIT: I tried to run the whole thing and, sadly, it doesn't work. It is, in fact, throws an error while throwing an error. Tried all configurations to no avail, goes with the same error, saying that .dll is corrupted or something, while LÖVE throws an error about invalid UTF-8.
It failed installation at the very final step with some obscure numerical error code with no description, I'm not bothering over searching for options to resolve. It's a fact that XBox360 controller works fine in all games I have that support it, so there's something wrong with the DLLs, provided upon hooking up Windows throws a system error with internationalized error message.
I don't know either, why we can't use both triggers on windows...
I thinks, I gonna add the home button (even if it will be unusable on windows) and stay with one value for the triggers (sadly...).
Edit : Now it's should work but i can't test it.
The Home button work on mac but doesn't on windows and the triggers should work the same way on windows and OSX.
Works great on OS X. Except for the Back and Start buttons being switched. Windows is fine though. Shame about the Home button not being recognized.
I wish you'd optionally make the two triggers return their separate values on OS X. Maybe via a flag we'd have to set manually.
Fortunately most features wouldn't really be used in most Löve games. Still it's great to have options. (The mixed up buttons on OS X caused me some confusion a few weeks ago when I installed Half-Life 2 onto OS X and the controller wouldn't work right. Now I know why.)
I edited the first post.
Start and Back should not be switched now and each triggers have his own value (the global one stay).
So we can choose if OSX users will be able to use both triggers at the same time or not.
Could you maybe make a single "xboxlove:init()" function that we could just call easily from the start. I look at the source of your demo.love and I'm not completely sure which code I need and which is just for the app. And I read the methods section and am confused. For now I'll just try and copy what's in the demo, but it's confusing from the start.
I mean it says I just need to use the update function but in your demo you're using other extra code and setting joysticks and deadzones. I just want to plop it into a project and use maybe 2 lines to load and update it. Like what does joystick = 1 mean? Does that mean we can use two or more? How exactly do you go about it? (Not that I have more than one)
Edit: Also, how do I use this on 0.9.0? When I try to run it it says "getNumJoysticks is a nil value". 0.9.0 seems to have changed how Joysticks work. Can one of the 0.9.0 people chime in maybe? I'd loooove to get this working in 9. Maybe we can get this working on both 8 and 9 since 9 is apparently coming soon™*. Should be pretty easy, I just don't know how Joysticks work on 9 let alone 8. So I don't know what to change.
Not a good idea at all to do that, but hey.
0.9.0 pretty much deprecates the entire joystick API, so have fun!
Plus, 0.9.0 isn't even released yet, so I wouldn't really advocate such a thing. (Especially when the API is about as stable as a chihuahua on crack)
But uh, it's his lib, so who knows.
"I view Python for game usage about the same as going fishing with a stick of dynamite. It will do the job but it's big, noisy, you'll probably get soaking wet and you've still got to get the damn fish out of the water." -taylor
NightKawata wrote:Not a good idea at all to do that, but hey.
0.9.0 pretty much deprecates the entire joystick API, so have fun!
Plus, 0.9.0 isn't even released yet, so I wouldn't really advocate such a thing. (Especially when the API is about as stable as a chihuahua on crack)
But uh, it's his lib, so who knows.
I'm sure 0.9.0 will have replacements for the current Joystick API that will work just as well. Otherwise it'd be suicide. Can someone from the dev team please chime in here?
The new 0.9.0 Joystick API is not finalized yet. The main repository / builds for 0.9.0 don't have any changes related to SDL 2 in yet, so the Joystick API there is not what it is in the SDL 2 branch (although it's still a tiny bit different from the old 0.8.0, mostly some renamed functions for consistency.)
I think you will be happy with the changes and additions though.