webretro icon indicating copy to clipboard operation
webretro copied to clipboard

mobile support?

Open RuralAnemone opened this issue 2 years ago • 6 comments

would it be possible to detect if you're on mobile and then have some controls overlayed?

RuralAnemone avatar Jul 30 '22 14:07 RuralAnemone

That should be pretty easy to do, but I'll also need to add emscripten touch/pointer support in the rwebinput driver in order to make it work. Mobile support is something that I've wanted to do for a while, so I'll see what I can do.

BinBashBanana avatar Jul 30 '22 17:07 BinBashBanana

Actually, I’d recommend doing what the original emulatorjs did, they have a simulate input function that sends the button presses to the emulator, so all of the listeners are actually in JavaScript. The control mapping is all JavaScript too, and all virtual game pad does in the original emulatorjs version is that it calls this simulate input function with specific button presses, this’d be pretty difficult to do though, I’ve tried to rewrite the input driver to support it so control mapping and virtual game pad would work on my new versions but I’ve never been able to figure out how it worked

ethanaobrien avatar Jul 30 '22 18:07 ethanaobrien

Good news - touchscreen support will be in the next update! I'm using the neo-retropad overlay which has an option to toggle between d-pad and analog.

BinBashBanana avatar Aug 22 '22 19:08 BinBashBanana

Here's a preview:

Show

Screenshot 2022-08-23 230335


Screenshot 2022-08-23 230538

The controls will also move to the side of the screen if the screen is horizontal, just like mobile RetroArch.

BinBashBanana avatar Aug 24 '22 03:08 BinBashBanana

oh wow you did a lot more than I thought lol :)

looks great!

RuralAnemone avatar Aug 26 '22 16:08 RuralAnemone

very expect

szllzs avatar Aug 29 '22 01:08 szllzs