Skip to main content

Touch

Functions

FunctionDescription
clearTouchIdentifierClear the touch identifier that tracks which touch stream to pay attention to. This ends the current drag/gesture and allows other pointers to be captured.
shouldHandleEventDecide whether Blockly should handle or ignore this event. Mouse and touch events require special checks because we only want to deal with one touch stream at a time. All other events should always be handled.
getTouchIdentifierFromEventGet the pointer identifier from the given event.
checkTouchIdentifierCheck whether the pointer identifier on the event matches the current saved identifier. If the current identifier was unset, save the identifier from the event. This starts a drag/gesture, during which pointer events with other identifiers will be silently ignored.

Variables

VariableDescription
TOUCH_ENABLEDWhether touch is enabled in the browser. Copied from Closure's goog.events.BrowserFeature.TOUCH_ENABLED
TOUCH_MAPThe TOUCH_MAP lookup dictionary specifies additional touch events to fire, in conjunction with mouse events.