docs
Loading...
Searching...
No Matches
CAPI_ScrollEvent.h

Overview

Scroll event interface.

#include <Ultralight/CAPI/CAPI_ScrollEvent.h>

This file defines the C API for scroll events.

Functions

ULScrollEvent ulCreateScrollEvent (ULScrollEventType type, int delta_x, int delta_y, int x, int y)
 Create a scroll event.
void ulDestroyScrollEvent (ULScrollEvent evt)
 Destroy a scroll event created by ulCreateScrollEvent().
ULScrollEventType ulScrollEventGetType (ULScrollEvent evt)
 Get the scroll granularity type of a scroll event.
int ulScrollEventGetDeltaX (ULScrollEvent evt)
 Get the horizontal scroll amount.
int ulScrollEventGetDeltaY (ULScrollEvent evt)
 Get the vertical scroll amount.
int ulScrollEventGetX (ULScrollEvent evt)
 Get the x-position of the cursor when the event occurred.
int ulScrollEventGetY (ULScrollEvent evt)
 Get the y-position of the cursor when the event occurred.

Function Documentation

◆ ulCreateScrollEvent()

ULScrollEvent ulCreateScrollEvent ( ULScrollEventType type,
int delta_x,
int delta_y,
int x,
int y )

Create a scroll event.

Positive deltas scroll up (or left), like a mouse wheel turned away from the user. Pages that read the legacy wheelDelta properties see 120 for every 100 pixels (or every page) of delta. Modifier keys reported to the page come from the last key event fired on the View.

Parameters
typeThe scroll granularity type.
delta_xHorizontal scroll amount, in the unit named by type (logical pixels, or pages).
delta_yVertical scroll amount, in the unit named by type (logical pixels, or pages).
xThe x-position of the cursor when the event occurred, in logical pixels relative to the View. Pass a negative value to dispatch at the last known cursor position instead; if either coordinate is negative, both are ignored.
yThe y-position of the cursor when the event occurred, in logical pixels relative to the View. Same sentinel rule as x.
Returns
Returns a new ULScrollEvent instance. You must call ulDestroyScrollEvent() when finished.

◆ ulDestroyScrollEvent()

void ulDestroyScrollEvent ( ULScrollEvent evt)

Destroy a scroll event created by ulCreateScrollEvent().

◆ ulScrollEventGetDeltaX()

int ulScrollEventGetDeltaX ( ULScrollEvent evt)

Get the horizontal scroll amount.

Parameters
evtThe scroll event.
Returns
Returns the horizontal scroll amount, in the unit named by the event's type.

◆ ulScrollEventGetDeltaY()

int ulScrollEventGetDeltaY ( ULScrollEvent evt)

Get the vertical scroll amount.

Parameters
evtThe scroll event.
Returns
Returns the vertical scroll amount, in the unit named by the event's type.

◆ ulScrollEventGetType()

ULScrollEventType ulScrollEventGetType ( ULScrollEvent evt)

Get the scroll granularity type of a scroll event.

Parameters
evtThe scroll event.
Returns
Returns the scroll granularity type (see ULScrollEventType).

◆ ulScrollEventGetX()

int ulScrollEventGetX ( ULScrollEvent evt)

Get the x-position of the cursor when the event occurred.

Parameters
evtThe scroll event.
Returns
Returns the x-position, in logical pixels relative to the View, or a negative value if the event dispatches at the last known cursor position.

◆ ulScrollEventGetY()

int ulScrollEventGetY ( ULScrollEvent evt)

Get the y-position of the cursor when the event occurred.

Parameters
evtThe scroll event.
Returns
Returns the y-position, in logical pixels relative to the View, or a negative value if the event dispatches at the last known cursor position.

Go to the source code of this file.