Improves mobile support. Even though it doesn't completely makes touch-based devices supported, this makes it possible for developers to implement full support on their applications (by customizing State).
How?
Added 3 touch events to InputType.
Changed getActionsForEvent method on ActionEventBus.
Changed AbstractDisplacementState to listen for touch events.
Added onTouch(Start/End/Move) event handlers on CanvasWidget.
This is a mini version of #488 that only enables dragging. The advantage is that this PR could be shipped more easily. Maybe we could work on node dragging/link creation on future versions.
Checklist
yarn run pretty
beer/coffeecoke because you are awesomeWhat?
Adds support for touch events (
touchstart
,touchmove
andtouchend
). Enables touch dragging the canvas by default.P.S.: this is already working on logossim, changes applied using
patch-package
on this PR: https://github.com/renato-bohler/logossim/pull/59Example:
https://user-images.githubusercontent.com/25781956/114326338-b0049280-9b0a-11eb-909c-2d2340bcfcd6.mp4
Why?
Improves mobile support. Even though it doesn't completely makes touch-based devices supported, this makes it possible for developers to implement full support on their applications (by customizing State).
How?
InputType
.getActionsForEvent
method onActionEventBus
.AbstractDisplacementState
to listen for touch events.onTouch(Start/End/Move)
event handlers onCanvasWidget
.DefaultState
.Feel good image: