Highlighted

GameInputEvent.DEVICE_REMOVED doesn't trigger itself

New Here ,
Jan 19, 2016

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.

TOPICS
Air beta

Views

450

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

GameInputEvent.DEVICE_REMOVED doesn't trigger itself

New Here ,
Jan 19, 2016

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.

TOPICS
Air beta

Views

451

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jan 19, 2016 0
Adobe Employee ,
Jan 19, 2016

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 19, 2016 0
AntoninL LATEST
New Here ,
Jan 19, 2016

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 19, 2016 0