FYI, just added Lime Joystick events. These work alongside Gamepad events, so if something is not registering properly as a gamepad, or just want to see the raw events coming from the device, should be possible to watch now
Does this work in the current Lime, or do we need a newer SDL? Using the latest from the ānative-toolkitā submodule, but I think its before the MFi game controller commit. Now that things are working, though, should be possible to update. Also, might be able to begin including tvOS builds with Lime by default. Do you think weāre there yet?
It works with Lime and the latest SDL from their repo + my tvOS branch, so no, weāre not there yet. I need @slime73 to merge my changes to his AppleTV branch and get that whole stuff into the mainstream SDL repo before we can actually distribute something for tvOS.
You can obviously connect to Lime events directly, even from OpenFL. Internally, the new joystick events are ignored for the moment (since the gamepad events are better, in general) and OpenFL GameInput is connected to those.
If you choose to use that API, it looks like this:
import openfl.events.Event;
import openfl.events.GameInputEvent;
import openfl.ui.GameInput;
...
var input = new GameInput ();
input.addEventListener (GameInputEvent.DEVICE_ADDED, function (e) {
trace ("Connected game input: " + e.device);
for (i in 0...e.device.numControls) {
var control = e.device.getControlAt (i);
control.addEventListener (Event.CHANGE, function (e) trace ("Control " + control.id + ": " + control.value));
}
});
Thanks @singmajesty
It looks like something is broken between OpenFL and Lime as I get no events being fired by any of the controls of the Apple TV Remote. But if I hook up Lime directly, it works.
Do you mean, that once OpenFL is hooked up, you donāt get any of the Lime events (using lime.ui.Joystick directly), or do you mean that the OpenFL GameInput events do not fire?
Iām using -Dnext with HaxeFlixel or I canāt even target tvOS.
If HaxeFlixel is consuming events just like OpenFL, it might be the same problem as those GameInput events of OpenFL not firing.
OpenFL GameInput is based on Lime Gamepad, so if you get Joystick but no Gamepad, it means that the device is not wired up with device mappings so that SDL recognizes it as a gamepad. Have you gotten Gamepad events firing in Lime yet?
No idea. I checked HaxeFlixelās code and when a device gets connected it forcibly sets enabled to true. So I guess itās been there for a while
Now Iām trying to understand why HaxeFlixel is seeing the gamepad and the buttons come through but they do not get to my code. I wonder if I should remap the buttons somewhere in HaxeFlixelās code. Gonna dig more into it.
Enable or disable an input device. Devices are initially disabled by default (enabled set to false). You must explicitly enable a device, by setting enabled to true, before you can get control values from the device.
I still miss the correct mapping for MFi controllers that arenāt the Apple TV Remote though.
The bad thing is that the Mode demo runs extremely slow. And thatās weird. Iāve got some Unity projects running on the new Apple TV and they have a super high framerate.
Iām installing the new beta of XCodeā¦ waiting for it to finish.
Iāll run both the old BunnyMark as suggested by Justo Delgado (it uses the same Tilesheet stuff currently used by Flixel) and the latest and check if thereās any difference.