Copy link to clipboard
Copied
Hi everyone,
I'm trying to detect when my gamepad is deconnected in order to reconnect it later. When I initialize my gamepad, I add listener to GameInputEvent.DEVICE_ADDED, and GameInputEvent.DEVICE_REMOVED. The first one well triggers itselft but only at the beginning, and when I add some others devices it is not trigger again. Moreover event DEVICE_REMOVED, doesn't trigger at all.
if (Game.gameinput == null){
Game.gameinput = new GameInput();
gameinput.addEventListener(GameInputEvent.DEVICE_ADDED,onDeviceAdded);
gameinput.addEventListener(GameInputEvent.DEVICE_REMOVED,onDeviceRemoved);
}
This function is static, and onDeviceAdded and onDeviceRemoved too.
Do you have some ideas ?
Thanks.
Copy link to clipboard
Copied
Hi,
Could you please try reproducing the bug at your end using the sample project shared below:
And please share the specification of the gamepad that you are using at your end.
Thanks,
Adobe AIR Team
Copy link to clipboard
Copied
Hi,
Thank you for your time. The sample project you give me works perfectly. I'm using a Flare device https://flareplay.com/‌ with its own gamepad. So i target Android TV device. I test your sample project on the same device.
I am also using Haxe language to develop. Maybe it's the problem but I'm using a lot of others flash lib without any trouble..:/
Antonin.