Hello.
I get trouble handling joystick events with the current version of openfl.
I followed Joshua’s exemples and even looked at how it’s handled in haxePunk (the same way, in fact) but my nes usb gamepad is not found at all
No result on Neko/C++.
My HaxePunk older builds (with older lib versions) still work, so I know it’s not because of the gamepad itself…
Could someone try it on another computer, with any usb gamepad plugged in ?
I’m on windows 8.1.
hmmm. just tried with my 360 controller, but no that doesnt work with it. though did try my other code for joysticks, which did work. sometihng quick and dirty @singmajesty cropped up for when i asked ‘how the chuff can joysticks work in openfl’
package;
import openfl.display.Sprite;
import openfl.Lib;
// import openfl.events.JoystickEvent;
// import openfl.display.SimpleButton;
class Main extends Sprite {
public function new () {
super ();
Lib.application.window.onGamepadAxisMove.add (function (gamepad, axis, value) {
trace ("Gamepad " + gamepad.id + " axis " + axis + " = " + value);
});
}
}
That’s weird, isn’t it ?
I tested it with a nes usb pad, a snes buffalo one, and a generic ps2 controller.
Same result for all.
All recognised in my previous builds based on older versions of haxe/neko/lime/openfl…
I may try do downgrade a bit and see what happens.
aye the code i posted was using the latest of everything. and that code you posted back up, the update version of the one i did. that works completely fine for me
this post is good actually. ive still had trouble getting joysticks to work, not in your case, but just understanding them more than anything. so this ahas slightly cleared up a few thing
I’m going to try on another computer, and see what happens…
It’s strange that I’m the only one with this issue, and that it worked fine with previous versions on this same computer
I feel like I’m wasting my time.
Ok, let’s call the computer I struggle with the “new” one, and my old computer the “old” one.
The new one is up-to-date.
The old one isn’t (Haxe 3.1.1, Lime 1.0.1, OpenFL 2.0.1).
I made a build from the new one, with both Lime and OpenFL handling of joysticks :
doesn’t work on the new computer
doesn’t work on the old neither
No error but no detection.
I took the same source file, and made a build on the old computer : it works on both computers !
Except that the Lime method is off (creates an error, Lime version API issue I guess), but the official OpenFL method works great !
I guess now I should upgrade the old computer, or downgrade the new one… to continue testing.
This is really time consuming, but it’s important that I find a way to handle joysticks on my new computer, as I’ll have a professionnal use for it soon.
OpenFL 2.0.1
-> Lime 1.0.1 just doesn’t want to work and gives me a “does it need to be installed ?” when I try to run the setup.
And of course you can’t put an old version of OpenFL with a new Lime.
Looking at all the versions of both, I managed to put together Lime 2.2.2 and OpenFL 2.2.8… and it works, joysticks are back with openfl.events.JoystickEvent !
I think I’m going to stick with it for now, as Lime 2.4.3 + OpenFL 3.0.8 is a fail to me (on the joysticks side).
I’ll check with next releases to see if the issue disappears…
The strange thing is : I don’t know what the problem is, and I don’t know why I seem to be the only victim of it
@lewislepton Where you using openfl in legacy mode ?
I posted on github and was able to detect my gamepads with HaxeFlixel… I finally found out flixel is using the legacy mode, and now it works fine for me as long as I don’t use the hybrid mode.
I currently use <set name="openfl-legacy" /> in my project.xml.
I found about it here.
I have not been able to play with my gamepads in hybrid mode at all.
hmm thats strange. i dont have any trouble at all with the joystick. i dont use legarcy either. trying to not use it because i just want to use the later tech since only really just starting on it
so are you now on haxeflixel? i saw when playing abstractpixel, that it was haxepunk you used. just interested have been tempted to use haxeflixel to get some things done quicker. maybe, but trying not to