blockly > utils > browserEvents
utils.browserEvents namespace
Functions
Function |
Description |
bind(node, name, thisObject, func) |
Bind an event handler that should be called regardless of whether it is part of the active touch stream. Use this for events that are not part of a multi-part gesture (e.g. mouseover for tooltips). |
conditionalBind(node, name, thisObject, func, opt_noCaptureIdentifier) |
Bind an event handler that can be ignored if it is not part of the active touch stream. Use this for events that either start or continue a multi-part gesture (e.g. mousedown or mousemove, which may be part of a drag or click). |
getScrollDeltaPixels(e) |
Returns the scroll delta of a mouse event in pixel units. |
isRightButton(e) |
Returns true this event is a right-click. |
isTargetInput(e) |
Returns true if this event is targeting a text input widget? |
mouseToSvg(e, svg, matrix) |
Returns the converted coordinates of the given mouse event. The origin (0,0) is the top-left corner of the Blockly SVG. |
unbind(bindData) |
Unbind one or more events event from a function call. |
Type Aliases
Type Alias |
Description |
Data |
Blockly opaque event data used to unbind events when using bind and conditionalBind . |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[null,null,["Last updated 2024-09-18 UTC."],[[["The `utils.browserEvents` namespace provides functions for handling browser events in Blockly, such as binding, unbinding, and interpreting events."],["It includes functionalities to manage mouse and touch events, specifically for actions like dragging, clicking, and tooltips."],["Functions are available to identify right-clicks, target elements, and scroll delta, aiding in precise event handling."],["The namespace also offers utilities for converting mouse coordinates to SVG coordinates within the Blockly environment."],["`bindData` is a type alias representing opaque event data that can be used to unbind events previously bound using `bind` or `conditionalBind`."]]],[]]