docs
Loading...
Searching...
No Matches
WheelEvent

#include <Ultralight/dom/Event.h>

Overview

A wheel event (WheelEvent).

Get one with Event::AsWheel(). It adds the scroll amounts to the MouseEvent getters. The position and modifier keys work as for any mouse event, but button() and buttons() always read 0.

Inheritance diagram for WheelEvent:
MouseEvent Event

Public Member Functions

 WheelEvent (ULDOMEvent borrowed)
 Wrap an event handle from the C API (Event::AsWheel() is the usual way to get one).
double deltaX () const
 Get the horizontal scroll amount (deltaX).
double deltaY () const
 Get the vertical scroll amount (deltaY).
unsigned deltaMode () const
 Get the unit of the scroll amounts (deltaMode).
Public Member Functions inherited from MouseEvent
 MouseEvent (ULDOMEvent borrowed)
 Wrap an event handle from the C API (Event::AsMouse() is the usual way to get one).
double clientX () const
 Get the pointer's x-position in the viewport, in CSS pixels (clientX).
double clientY () const
 Get the pointer's y-position in the viewport, in CSS pixels (clientY).
double pageX () const
 Get the pointer's x-position in the page, in CSS pixels (pageX).
double pageY () const
 Get the pointer's y-position in the page, in CSS pixels (pageY).
double screenX () const
 Get the pointer's x-position relative to the View (screenX).
double screenY () const
 Get the pointer's y-position relative to the View (screenY).
int button () const
 Get the button that caused the event (button).
unsigned buttons () const
 Get the buttons held down during the event (buttons).
bool ctrlKey () const
 Whether or not the Control key was held down (ctrlKey).
bool shiftKey () const
 Whether or not the Shift key was held down (shiftKey).
bool altKey () const
 Whether or not the Alt key was held down (altKey).
bool metaKey () const
 Whether or not the Meta key was held down (metaKey).
Element relatedTarget () const
 Get the other element of a mouse transition (relatedTarget).
Public Member Functions inherited from Event
 Event (ULDOMEvent borrowed)
 Wrap an event handle from the C API.
 Event (const Event &)=delete
Event & operator= (const Event &)=delete
std::string type () const
 Get the event's type (type).
unsigned eventPhase () const
 Get the current dispatch phase (eventPhase).
bool bubbles () const
 Whether or not the event bubbles up the tree (bubbles).
bool cancelable () const
 Whether or not preventDefault() can cancel the event (cancelable).
bool isTrusted () const
 Whether or not the event came from user input or the library (isTrusted).
double timeStamp () const
 Get the time the event was created (timeStamp).
bool defaultPrevented () const
 Whether or not the event was canceled (defaultPrevented).
void preventDefault () const
 Cancel the event's default action (preventDefault).
void stopPropagation () const
 Stop the event from reaching other targets (stopPropagation).
void stopImmediatePropagation () const
 Stop the event from reaching any other listener (stopImmediatePropagation).
Element target () const
 Get the element the event was dispatched to (target).
Node targetNode () const
 Get the node the event was dispatched to (target).
Element currentTarget () const
 Get the element whose listener is running (currentTarget).
MouseEvent AsMouse () const
 View this event as a MouseEvent.
WheelEvent AsWheel () const
 View this event as a WheelEvent.
KeyboardEvent AsKeyboard () const
 View this event as a KeyboardEvent.
FocusEvent AsFocus () const
 View this event as a FocusEvent.
InputEvent AsInput () const
 View this event as an InputEvent.
SubmitEvent AsSubmit () const
 View this event as a SubmitEvent.
CustomEvent AsCustom () const
 View this event as a CustomEvent.
ULDOMEvent raw () const
 Get the C handle, for passing to the <Ultralight/CAPI/CAPI_DOMEvent.h> functions.

Constructor & Destructor Documentation

◆ WheelEvent()

WheelEvent ( ULDOMEvent borrowed)
inlineexplicit

Wrap an event handle from the C API (Event::AsWheel() is the usual way to get one).

Parameters
borrowedThe event handle passed to a C listener callback.

Member Function Documentation

◆ deltaMode()

unsigned deltaMode ( ) const
inline

Get the unit of the scroll amounts (deltaMode).

Returns
Returns 0 for pixels, 1 for lines, or 2 for pages. Wheel events from View::FireScrollEvent() are in pixels or pages (ScrollEvent::kType_ScrollByPixel or ScrollEvent::kType_ScrollByPage).

◆ deltaX()

double deltaX ( ) const
inline

Get the horizontal scroll amount (deltaX).

Returns
Returns the amount, in the unit deltaMode() gives (0 for an event that isn't a wheel event).

◆ deltaY()

double deltaY ( ) const
inline

Get the vertical scroll amount (deltaY).

Returns
Returns the amount, in the unit deltaMode() gives (0 for an event that isn't a wheel event).

The documentation for this class was generated from the following file: