Canvas event handling: Difference between revisions

Jump to navigation Jump to search
Update info on mouse events.
(→‎Example Code: No need to manually create window decoration any more)
(Update info on mouse events.)
Line 69: Line 69:
{| class="wikitable"
{| class="wikitable"
|-
|-
! Type !! Description !! DOM equivalent event !! Notes
! Type !! Description !! DOM equivalent event !! Bubbles <ref>Bubbling phase. DOM Level 3 event flow. http://www.w3.org/TR/DOM-Level-3-Events/#event-flow</ref>
|-
|-
| ''mousedown'' || Mouse button pressed || [http://www.w3.org/TR/DOM-Level-3-Events/#event-type-mousedown mousedown] ||
| ''mousedown'' || Mouse button pressed || [http://www.w3.org/TR/DOM-Level-3-Events/#event-type-mousedown mousedown] || {{tick}}
|-
|-
| ''mouseup'' || Mouse button released || [http://www.w3.org/TR/DOM-Level-3-Events/#event-type-mouseup mouseup] ||
| ''mouseup'' || Mouse button released || [http://www.w3.org/TR/DOM-Level-3-Events/#event-type-mouseup mouseup] || {{tick}}
|-
|-
| ''click'' || ''mousedown'' + ''mouseup'' have been triggered for this element without moving more than a certain maximum distance || [http://www.w3.org/TR/DOM-Level-3-Events/#event-type-click click] ||
| ''click'' || ''mousedown'' + ''mouseup'' have been triggered for this element without moving more than a certain maximum distance || [http://www.w3.org/TR/DOM-Level-3-Events/#event-type-click click] || {{tick}}
|-
|-
| ''dblclick'' || Two ''click'' events have been triggered for this element without moving more than a certain maximum distance and time limit || [http://www.w3.org/TR/DOM-Level-3-Events/#event-type-dblclick dblclick] ||
| ''dblclick'' || Two ''click'' events have been triggered for this element without moving more than a certain maximum distance and time limit || [http://www.w3.org/TR/DOM-Level-3-Events/#event-type-dblclick dblclick] || {{tick}}
|-
|-
| ''drag'' || The mouse has been moved with a button down. After dragging has started above an element, all consecutive ''drag'' events are sent to this element even if the mouse leaves its area || ||
| ''drag'' || The mouse has been moved with a button down. After dragging has started above an element, all consecutive ''drag'' events are sent to this element even if the mouse leaves its area || || {{tick}}
|-
|-
| ''wheel'' || Mouse wheel rotated (see deltaY for direction) || [http://www.w3.org/TR/DOM-Level-3-Events/#event-type-wheel wheel] ||
| ''wheel'' || Mouse wheel rotated (see deltaY for direction) || [http://www.w3.org/TR/DOM-Level-3-Events/#event-type-wheel wheel] || {{tick}}
<!--|-
| ''mousemove'' || TODO || [http://www.w3.org/TR/DOM-Level-3-Events/#event-type-mousemove mousemove] ||-->
|-
|-
| ''mouseover'' || TODO || [http://www.w3.org/TR/DOM-Level-3-Events/#event-type-mouseover mouseover] ||
| ''mousemove'' || Mouse has moved while beeing inside the area of the target element. || [http://www.w3.org/TR/DOM-Level-3-Events/#event-type-mousemove mousemove] || {{tick}}
|-
|-
| ''mouseout'' || TODO || [http://www.w3.org/TR/DOM-Level-3-Events/#event-type-mouseout mouseout] ||
| ''mouseover'' || Mouse has entered a child or the element itself. ''mouseover'' is also triggered if the mouse moves from one child element to another.  || [http://www.w3.org/TR/DOM-Level-3-Events/#event-type-mouseover mouseover] || {{tick}}
<!--|-
| ''mouseenter'' || TODO || [http://www.w3.org/TR/DOM-Level-3-Events/#event-type-mouseenter mouseenter] || not triggered yet-->
|-
|-
| ''mouseleave'' || TODO || [http://www.w3.org/TR/DOM-Level-3-Events/#event-type-mouseleave mouseleave] ||
| ''mouseout'' || Mouse has left a child or the element itself. ''mouseout'' is also triggered if the mouse moves from one child element to another. || [http://www.w3.org/TR/DOM-Level-3-Events/#event-type-mouseout mouseout] || {{tick}}
|-
| ''mouseenter'' || Mouse has entered a child or the element itself. In contrary to ''mouseover'', ''mouseenter'' is not triggered if the mouse moves from one child element to another, but only the first time the element or one of its children is entered. || [http://www.w3.org/TR/DOM-Level-3-Events/#event-type-mouseenter mouseenter] || {{cross}}
|-
| ''mouseleave'' || Mouse has left the element and all of its children. In contrary to ''mouseout'', ''mouseleave'' is not triggered if the mouse moves from one child element to another, but only if the mouse moves outside the element and all its children. || [http://www.w3.org/TR/DOM-Level-3-Events/#event-type-mouseleave mouseleave] || {{cross}}
|}
|}


Line 146: Line 146:
})();
})();
</syntaxhighlight>
</syntaxhighlight>
<references/>
166

edits

Navigation menu