linuxserver / docker-emulatorjs

Web based retro emulation frontend with rom scanning and automated art ingestion.
GNU General Public License v3.0
512 stars 51 forks source link

Gamepad detects inside the game but not in the menu, no way to come to home without reloading the browser back. #7

Closed mastan30 closed 2 years ago

mastan30 commented 2 years ago

Can only detect Gamepad inside the game but not in the menu for the navigating through games, Also there's no way to come back to home once inside the game.

thelamer commented 2 years ago

So this is something on the backburner for a long time. Basically the issue is that I have had it working in many forms, the problem is compatibility and bugs. With the biggest issue being my primary focus being the Edge browser on Xbox consoles.

One thing I will say is the back button will always be how you exit a game that will never change, mapping shortcuts to do so is a nightmare to not have a potential conflict. That and double capturing the gamepad via my logic battles with the emulators dynamically loaded in.

The Gamepad api on browsers seems to get in a weird state if you try to disconnect and pass it off the to the emulator dynamically loaded in on launch. I cannot simply reload the window as I need a functional user state that says they have interacted with the page to load the emulator properly (stuff like canvas rendering and audio output does not work as the browser blocks it until a user is actually clicking on the page). Now it does kind of work in most scenarios, but it is hit or miss, which led me to leave it out.

The focus of this project is to get emulators running where they are not supposed to, the "cool" factor of running an emulator in a web browser wears off quickly when you compare the performance and compatibility to running the stuff natively on non sandboxed environments. (web browsers are limited to single a single processor thread with bad opengl compatibility thus why you see no super modern emulators here not to mention the game data needs to be loaded in ram basically killing off the hopes for anything DVD based) With that in mind you are kind of looking at iPhones/iPads/Xbox consoles and basically anything else with a decent modern web browser. You only should be resorting to web based emulation when you don't have another more viable option without serious modification to the device in question.

Just trying to explain why I developed the logic and intentionally left it out, it messes with Xbox working properly and will likely cause random controller lockouts on other platforms too especially considering I don't have overarching control over the codebase for the emulators that are being loaded in from the frontend.

Long story short this behavior will not change.