How to achieve a horizontal screen on a mobile phone

I want to create a scene that can automatically rotate the screen by 90° without using the phone’s horizontal screen function. Just like this demo.(Please open this demo with your mobile phone)
I now rotate the canvas 90° to achieve this effect, but it will cause confusion in mouse events.
what should I do?

Did you try to change camera.upVector?

thank you!