Skip to content

Conversation

@jefvel
Copy link
Contributor

@jefvel jefvel commented Jan 26, 2023

Currently, if a player clicks and drags the mouse outside the game window, it'll act as if the mouse was released. It's not consistent with the other non-HTML5 targets.

This PR fixes that. It makes it possible to click, drag, and move the mouse outside the game window. If the user releases the mouse button outside the window it'll trigger as expected.

I've tested this in chrome+firefox and iOS and Android.

An optional feature would be to add the following CSS to the index.html file.

      html,
      body,
      canvas {
        touch-action: none;
        touch-action-delay: none;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none !important;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
      }

However, it's not really needed. But it helps on mobile targets.

@jefvel jefvel changed the title Made mousemove events work when clicking and then dragging outside the game window Improve mousemove/mouseup when dragging outside the game canvas Jan 26, 2023
@RowanFuture
Copy link
Contributor

+1 this would be great

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

Successfully merging this pull request may close these issues.

2 participants