Jump to content

Gamepad OnConnected Only Fired First Browser Seesion


Recommended Posts

The gamepad attachControl uses: new BABYLON.Gamepads((pad: BABYLON.Gamepad) => { this.onGamepadConnected(pad); });

but this.onGamepadConnected ONLY gets fired ONCE per browser session... If you refresh the page page it never gets fired thus the game pad no longer works... If i totally close down the browser and restart it works again because new instance of browser... What can we do about that???


Link to comment
Share on other sites

Hey Dave (davrous):

Are you handling the GamePad? If So, the gamepad does fire on page refresh.  basically if the game pad is already attached to the page (available with navigator.getGamepads()[0]) then On Game Pad connected NEVER gets fired... I think we need to mod the code to check if the gamepad is already attached then use that attached gamed and create a BABYLON.Gamepad wrapper and call _callbackOnGamepadConnected... That way we still get the on gamepad connected event that drive out gamepad usage whether the gamepad is already attached or actually just got activated because use hit the but on a "CLEAN PAGE"... Let me know what you think... 

Note: It may only be an issue on MAC OS X... but on each browser on mac... The browser session itself has to be shutdown and reopened to get that on connected event... Probably on mac the instance is still alive with that gamepad still attached... even if you refresh the page.



Sorry don't know how to do the User Name Tag thing you have next to "Ping" @davrous


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...