Mouse problems with HTML5

Hello everyone,
I’m trying to make a summary of the situation (updated to 4.16) of mouse problems when playing a project packed for HTML (I’m testing on Firefox 53.0.3 64 bit)

How I’ve set up the test project:

  • Create an FPS project for mobile
  • Create a widget, create a button inside of the widget with an “on clicked” event (I connected a print string “FIRE!!” to test the working button)
  • Then in the level blueprint I’ve set as in the image below!

Then I start to list all the cases:

Example1

In project setting → Input I leave all untouched
I pack for html and try on browser
Result: I see the touch interface, I can click 1000 times the mouse won’t lock to the screen, so I have a bad navigability since the mouse pointer from the browser is interfering with the game’s mouse coordinates, so my turn/lookup angles are limited, BUT when I press “P” the button is clickable and working

Example2

In project setting → Input I un-tick “use mouse for touch”
(I un-ticked even the “always show touch interface” and cleared the default touch interface to get rid of the mobile interface but that’s not the problem, I checked with a test that this problem is brought by “use mouse for touch” option)

I pack for html and try on browser
Result: I don’t have the mobile interface, when I click in the viewport my mouse is caught and locked by the browser, so it disappears, my navigation is perfect, but when I press “P” the mouse is not coming back and the button is unreachable and I cannot make it work

Example3

In project setting → Input I un-tick “use mouse for touch” and “capture mouse on launch”, set to not capture and do not lock

I pack for html and try on browser
Result: it happens the same as in example 2, so I don’t have the mobile interface, when I click in the viewport my mouse is caught and locked by the browser, so it disappears, my navigation is perfect, but when I press “P” the mouse is not coming back and the button is unreachable and I cannot make it work

Example4 and 5

In project setting → Input I un-tick “use mouse for touch” and “capture mouse on launch”, set to not capture and do not lock
Tn the level blueprint I’ve changed “Set Input Mode Game Only” with “Set Input Game and UI” (choosing to not lock and not hide cursor on capture)

I pack for html and try on browser
Result: my mouse is visible and isn’t caught by the browser when I click on viewport, now to look around I have to click and drag with the mouse (it works correctly), I don’t have the mobile interface, when I press “P” my mouse is still visible and the button is reachable and it work; BUT if in level blueprint I tick “hide cursor during capture”: when the game start on browser the mouse is still visible, if I try to click and drag to look around the character go really crazy as if the turn/lookup rate is way higher (and during the drag the mouse doesn’t hide)

Example6

This case is more difficult to make it standard, since I noticed in one of my projects and I usually work with sublevels: to put it simple I start in the permanent level blueprint with a “set input mode UI only” and only after clicking on a widget button (basically my main menu) I actually load my sublevels and pass to “set input mode game only”; so when I test in browser at the beginning I can click 100 times in viewport and the browser doesn’t caught my mouse, BUT as soon as I go on and enter in the actual game my mouse is caught by browser and I restart to have all the previous issues (from examples 1 to 5)

Hello Hainzgrimmer,

I am going to go through your issue one at a time.

Issue 1

I believe this is working as intended. with HTML the mouse stays and does not lock because of the use mouse for touch event, this coupled with the virtual joypad keep the mouse from getting captured by the screen.

Issues 2 & 3

I believe the issue you are experiencing here is a bug and I have logged it here:

You can track the report’s status as the issue is reviewed by our development staff. Please be aware that this issue may not be prioritized or fixed soon.

Issue 4

I believe this is working as intended because the mouse is not getting captured on launch, you do have to click and drag, to move around the screen.

Issue 5

For the same reason as number 4, I believe this is working as intended.

Issue 6

For this issue, I need more information about your sub levels & set up to test, as I was unable to achieve the same result as you produced.

Cheers!

Hi ,
as in my post about fullscreen issues, I’ve just made a long case list of “try-and-see-what-happen” about mouse management in html, so indeed my example 4 work as intended but even in my examples 1 and 5 I think there is something wrong/not properly working:

EXAMPLE 1

the default FPS project under project setting → input has “Default viewport mouse capture mode” set on “capture permanently including initial mouse down”, and “default viewport mouse lock mode” set on “lock on capture”: those shouldn’t mean that the mouse should been captured by the browser?

EXAMPLE 5

if I set “Set Input Game and UI” with “hide cursor during capture” active, not only my mouse doesn’t hide during the click-drag movement, but overall the mouse input is like x100 times more sensible, so simply looking around become extremely difficult!

EXAMPLE 6

I’ve created a project from 0 and tried to make it simpler I could:

  • I created an FPS default project
  • In Project Setting → Input, I just un-tick “Use Mouse for Touch”
  • I created 2 new levels (named “Base Level” and “MainMenuLevel” ), opened BaseLevel, set it as Editor Startup Map and Game Default Map, added the other two levels as sublevels of BaseLevel

  • I created a Blueprint Interface and named a function “LoadLevelEvent” inside it, then I created 2 Widget (named “MainMenu” and “PauseMenu”) and set the as in the image

  • I set BaseLevel’s and MainMenuLevel’s Level Blueprints as in the images

  • I packed the project for HTML5

What happen trying it: in the MainMenu I can click 1000 times the mouse won’t be captured/locked by the browser; when I click the button Play it load correctly the FirstPersonExampleMap and still the mouse is visible and not-captured (but I can look around, with a bad navigabilty), if I click outside the viewport then click inside the viewport the mouse will be captured (at this point good navigabilty); if I press “P” on keyboard “PauseMenu” will open but mouse won’t show anymore (same problem as in EXAMPLE 2 ) so the button is unreachable.