Skip to main content
AntoninL
Participant
January 19, 2016
Question

GameInputEvent.DEVICE_REMOVED doesn't trigger itself

  • January 19, 2016
  • 1 reply
  • 579 views

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 has been closed for replies.

1 reply

deesharm
Adobe Employee
Adobe Employee
January 19, 2016

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

AntoninL
AntoninLAuthor
Participant
January 19, 2016

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.