docs
Loading...
Searching...
No Matches
CAPI_MouseEvent.h

Overview

Mouse event interface.

#include <Ultralight/CAPI/CAPI_MouseEvent.h>

This file defines the C API for mouse events.

Functions

ULMouseEvent ulCreateMouseEvent (ULMouseEventType type, int x, int y, ULMouseButton button)
 Create a mouse event.
void ulDestroyMouseEvent (ULMouseEvent evt)
 Destroy a mouse event created by ulCreateMouseEvent().
ULMouseEventType ulMouseEventGetType (ULMouseEvent evt)
 Get the type of a mouse event.
int ulMouseEventGetX (ULMouseEvent evt)
 Get the x-position of the mouse.
int ulMouseEventGetY (ULMouseEvent evt)
 Get the y-position of the mouse.
ULMouseButton ulMouseEventGetButton (ULMouseEvent evt)
 Get the mouse button that was pressed or released.

Function Documentation

◆ ulCreateMouseEvent()

ULMouseEvent ulCreateMouseEvent ( ULMouseEventType type,
int x,
int y,
ULMouseButton button )

Create a mouse event.

Modifier keys reported to the page come from the last key event fired on the View, so you should forward modifier key presses and releases as key events. A right-button click also fires contextmenu on the page (after the release on Windows, after the press elsewhere); the library shows no menu of its own.

Parameters
typeThe type of mouse event.
xThe current x-position of the mouse, in logical pixels relative to the View.
yThe current y-position of the mouse, in logical pixels relative to the View.
buttonThe mouse button that was pressed/released, if any.
Returns
Returns a new ULMouseEvent instance. You must call ulDestroyMouseEvent() when finished.

◆ ulDestroyMouseEvent()

void ulDestroyMouseEvent ( ULMouseEvent evt)

Destroy a mouse event created by ulCreateMouseEvent().

◆ ulMouseEventGetButton()

ULMouseButton ulMouseEventGetButton ( ULMouseEvent evt)

Get the mouse button that was pressed or released.

Parameters
evtThe mouse event.
Returns
Returns the button, or kMouseButton_None if no button changed state.

◆ ulMouseEventGetType()

ULMouseEventType ulMouseEventGetType ( ULMouseEvent evt)

Get the type of a mouse event.

Parameters
evtThe mouse event.
Returns
Returns the type of mouse event (see ULMouseEventType).

◆ ulMouseEventGetX()

int ulMouseEventGetX ( ULMouseEvent evt)

Get the x-position of the mouse.

Parameters
evtThe mouse event.
Returns
Returns the x-position, in logical pixels relative to the View.

◆ ulMouseEventGetY()

int ulMouseEventGetY ( ULMouseEvent evt)

Get the y-position of the mouse.

Parameters
evtThe mouse event.
Returns
Returns the y-position, in logical pixels relative to the View.

Go to the source code of this file.