Open ajerni opened 7 years ago
Ooh, I second this! You could also let the user customize how to map the click events to touch events. The default might be: mousedown() = touch start mouseup() = touch end mouseover() = skipped or done right before mousedown() mouseout() = skipped (unless mouseout() is normally called after mouseup()?)
But an alternative option like this would be quite helpful: mouseover() = touch start mousedown() = touch end mouseup() = customizable delay after touch end mouseout() = touch is in progress, but then user drags outside click range, ending the touch on the object
This can accommodate interfaces designed with a mouse in mind, where highlighting before clicking is important. Examples might be a point-and-click game where the cursor changes based on what object is highlighted (to tell you what clicking on it will do). I've never tested that though, so the second option might require a brief instruction for the player/user or a carefully-designed tutorial space to get them used to it.
The API could contain both mouse events like mouseover() and touch events like touchstart() or something. There could be a window where the user can choose which touch events automatically activate which mouse events (or none, if they prefer).
Hey, this is a really good idea! I could get an options interface like that into the project settings window fairly easily.
The main problem with mobile stuff right now is that I don't have a proper smartphone to test with 😫 so hopefully soon that will change
Would it be possible to implement mobile features like touch events? For example a simple touch on the mobile screen should automatically be the same as the click event.