Skip to main content

Home > blockly > Touch

Touch namespace

Functions

FunctionDescription
checkTouchIdentifier(e)Check 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.
clearTouchIdentifier()Clear 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.
getTouchIdentifierFromEvent(e)Get the pointer identifier from the given event.
shouldHandleEvent(e)Decide 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.

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.