blockly > browserEvents
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 `browserEvents` namespace provides functions for managing browser events within Blockly, particularly for mouse and touch interactions."],["It offers methods for binding, conditionally binding, and unbinding event handlers to DOM elements."],["Functions are included to determine event specifics, such as right-clicks, scroll deltas, and target elements."],["It facilitates converting mouse event coordinates to SVG coordinates within the Blockly workspace."],["The namespace utilizes a `Data` type alias for managing event binding data for efficient unbinding."]]],[]]