Wicklets / wick-editor-2018

Archived - New repo is now at github.com/wicklets/wick-editor
GNU General Public License v3.0
515 stars 57 forks source link

Mouse/touch events on mobile #662

Open ajerni opened 7 years ago

ajerni commented 7 years ago

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.

kryptot7 commented 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.

kryptot7 commented 7 years ago

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). image

zachrispoli commented 7 years ago

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