Skip to main content
AntoninL
Participant
Jan 19, 2016 9:29 AM UTC
Question

GameInputEvent.DEVICE_REMOVED doesn't trigger itself

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.

This topic is closed to new replies. Start a new post to keep the conversation going.

2 replies

deesharm
Adobe Employee
Adobe Employee
Jan 19, 2016 1:00 PM UTC

Hi,

Could you please try reproducing the bug at your end using the sample project shared below:

Dropbox - untitled folder‌

And please share the specification of the gamepad that you are using at your end.

Thanks,

Adobe AIR Team

Translate
AntoninL
AntoninLAuthor
Participant
Jan 19, 2016 1:15 PM UTC

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.

Translate