I found that I can’t simulate mouse buttons, but there is a problem, I want to run H5 on the phone, click a position on the screen and drag it, you can view the mobile view, just like Ori 2, drag the mouse to view the map, if you can’t simulate the mouse In what way can operations be replaced?
Doesn’t the condition
"Mouse button down/Touch held" do what you’re after? If not, then maybe multitouch could be an alternative
My question may not be clear. I don’t know how to convert the page to the mobile phone. Adding behaviors can simulate keystrokes. How to let the mobile phone know that when I press and hold the left mouse button on the computer, I press and hold the screen on the mobile phone?
One more question, how do I know that my manipulation of the phone screen is the correct effect? How to make on the computer and view the effect on the mobile phone
If I am not misinterpreting your questions. What you are asking here is 1. How can you make press and hold behaviours work with touch and mouse input and 2. How do you simulate phone object effects on computer
Am I correct?
yes，I need my phone to understand what I hold, not just move
I believe you will have to invert your thinking on how to approach this problem.
Instead of trying to simulate mouse/touch input, you will need to add new ways to trigger the events that you have in your logic to respond to mouse/touch input.
If screen is touched => Drag screen using mouse.X(), mouse.Y()
Approach that allows simulation:
If screen is touched => SCREEN_DRAG = true; Drag.X = mouse.X(); Drag.Y=mouse.Y()
if SIMULATE_TOUCH => SCREEN_DRAG = true; Drag.X = SIMULATE_TOUCH.X; Drag.Y=SIMULATE_TOUCH.Y; SIMULATE_TOUCH = false;
if SCREEN_DRAG => Drag screen using Drag.X, Drag.Y; SCREEN_DRAG= false;
I know that’s a little high level pseudo code, but I hope it explains what I’m saying enough for you to understand the approach.