Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mobile vIrtual buttons appearance issue #14

Open
shaylevary opened this issue Jul 8, 2024 · 5 comments
Open

Mobile vIrtual buttons appearance issue #14

shaylevary opened this issue Jul 8, 2024 · 5 comments

Comments

@shaylevary
Copy link

shaylevary commented Jul 8, 2024

Hi,

When I try to enter the emulator script from my mobile, all the virtual buttons appeared messed.
Screenshot_20240708_183940_Chrome

Only after i click on customize/move virtual buttons icon (on the top right of the screen), it fix the issue, until I refresh the page again.

Screenshot_20240708_182233_Chrome

I will appreciate any help on fixing this issue, in order to make the virtual buttons appear correctly when starting the emulator.

@nenge123
Copy link
Owner

nenge123 commented Jul 15, 2024

mobile using touch event,more hand have more touchEvent。

in the emulatorjs every button sigle event (pointdown pointout)

when hand out of button will stop and move in button will running

you see gba.nenge.net is's using emulatorjs core and retroarch build bot core.

< div id="gamepad"> more button < /div>

gamepad.ontouchmove = func;
gamepad.ontouchstart = func;

func(event)
btn =[];
if(event.type=="touchstart") btn = [event.target];
else Array.from(event.touches,hand=>{
btn.push(document.elementFromPoint(hand.pageX,hand.pageY));
});

//The object that all fingers click
btn
//Cache the last click, if it is different, "press up" the different settings, otherwise it will be pressed.

@shaylevary
Copy link
Author

Hi,

First of all, thanks for the explanations.

The main problem is that after I changed the position of the buttons and then I press "Reset All" button in order to reset all buttons back to their original position, it does not save the buttons in their original position (after the rest), so if i refresh the page, the buttons return to the places I've moved them before the reset.
The only possibility that it will save the buttons locations after the reset is if I move one of the buttons a little and then press save button.

Is it possible to fix the emulatorjs.js code, so when I perform "Reset All" it will automatically keep the position of the buttons in their original place?

Thank you.

@nenge123
Copy link
Owner

To save the key layout, it should be enough to delete the corresponding localstore. There may be an error in the reset function, and the configuration has not been deleted

@shaylevary
Copy link
Author

Will you be able to fix the reset function, so it will save the key layout changes when click the reset button?
Or do you have any js command that I can add in order to reset key layout every time I refresh and enter the script?

@nenge123
Copy link
Owner

sorry, I am longtime no see this js,when i using steamdeck。apple ios accept emulator app.

It is recommended that you rewrite the button layout of the web simulator and run all cores independently. Its operating mechanism is actually very simple! Really, it's not complicated at all! In addition, multiplayer games are not difficult to achieve, just a post request and then open a persistent link.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants