docs
Loading...
Searching...
No Matches
MouseEvent

#include <Ultralight/MouseEvent.h>

Overview

Mouse event representing a change in mouse state.

Note
Coordinates are logical pixels: the View's device scale is not applied to them, so they run over View::width() and View::height() divided by View::device_scale(). Convert from your window's device pixels before firing the event.
Note
Modifier keys reported to the page (eg, shiftKey) come from the last KeyEvent fired on the View, so you should forward modifier key presses and releases as key events.
See also
View::FireMouseEvent()

Public Types

enum  Type { kType_MouseMoved , kType_MouseDown , kType_MouseUp }
 The various MouseEvent types. More...
enum  Button {
  kButton_None = 0 , kButton_Left , kButton_Middle , kButton_Right ,
  kButton_Back , kButton_Forward
}
 The various mouse button types. More...

Public Attributes

Type type
 The type of this MouseEvent.
int x
 The current x-position of the mouse, in logical pixels relative to the View.
int y
 The current y-position of the mouse, in logical pixels relative to the View.
Button button
 The mouse button that was pressed/released, if any.

Member Enumeration Documentation

◆ Button

enum Button

The various mouse button types.

Enumerator
kButton_None 
kButton_Left 
kButton_Middle 
kButton_Right 

The right button.

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.

kButton_Back 

The first side button ("back"), eg, X1 on Windows.

Reaches the page as MouseEvent.button 3; the library performs no history navigation of its own.

kButton_Forward 

The second side button ("forward"), eg, X2 on Windows.

Reaches the page as MouseEvent.button 4; the library performs no history navigation of its own.

◆ Type

enum Type

The various MouseEvent types.

Enumerator
kType_MouseMoved 

Mouse moved type.

kType_MouseDown 

Mouse button pressed type.

kType_MouseUp 

Mouse button released type.

Member Data Documentation

◆ button

Button button

The mouse button that was pressed/released, if any.

◆ type

Type type

The type of this MouseEvent.

◆ x

int x

The current x-position of the mouse, in logical pixels relative to the View.

◆ y

int y

The current y-position of the mouse, in logical pixels relative to the View.


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