Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::view::MouseEvent Struct Reference

Rich mouse/pointer event with position, modifiers, button state, pointer ID, and stylus properties. More...

#include <input_events.hpp>

Public Member Functions

bool isShiftDown () const
bool isCtrlDown () const
bool isAltDown () const
bool isCmdDown () const
bool isMetaDown () const
bool isMainModifier () const
bool isTouch () const
bool isPen () const
bool isWheel () const
bool isPrimary () const
bool isPress () const
 True for the initial button-down that begins a gesture.
bool isDrag () const
 True for a drag tick (pointer moved with the button held).
bool isRelease () const
 True for the button-up that ends a gesture.
bool hasExplicitPhase () const
 True when an explicit (non-automatic) phase is present.
const char * pointerTypeString () const
 W3C pointerType string.

Public Attributes

Point position
 Position in local view coordinates.
Point window_position
 Position in window coordinates.
MouseButton button = MouseButton::left
uint16_t modifiers = 0
 Bitfield of Modifier flags.
int pointer_id = 0
 0 = primary, >0 = additional touches (multi-touch)
int click_count = 1
 1=single, 2=double, 3=triple click
bool is_down = false
 True for mouse-down / touch-began events.
MousePhase phase = MousePhase::automatic
 Explicit gesture phase (see MousePhase).
bool is_cancelled = false
 True for touchesCancelled (→ pointercancel).
bool is_wheel = false
 True for scroll wheel events.
float scroll_delta_x = 0
 Horizontal scroll delta (positive = right).
float scroll_delta_y = 0
 Vertical scroll delta (positive = down).
PointerType pointer_type = PointerType::mouse
float pressure = 0.5f
 0.0–1.0 (0.5 = default for mouse)
float altitude_angle = 0
 Stylus tilt in radians (0 = perpendicular).
float azimuth_angle = 0
 Stylus rotation in radians (0–2π).
float movement_x = 0
 Host-reported horizontal movement since the prior event.
float movement_y = 0
 Host-reported vertical movement since the prior event.
bool has_movement_delta = false
 Movement fields came from the native host.

Detailed Description

Rich mouse/pointer event with position, modifiers, button state, pointer ID, and stylus properties.

Unified for mouse, touch, and pen input.

Member Function Documentation

◆ hasExplicitPhase()

bool pulp::view::MouseEvent::hasExplicitPhase ( ) const
inline

True when an explicit (non-automatic) phase is present.

◆ isAltDown()

bool pulp::view::MouseEvent::isAltDown ( ) const
inline

◆ isCmdDown()

bool pulp::view::MouseEvent::isCmdDown ( ) const
inline

◆ isCtrlDown()

bool pulp::view::MouseEvent::isCtrlDown ( ) const
inline

◆ isDrag()

bool pulp::view::MouseEvent::isDrag ( ) const
inline

True for a drag tick (pointer moved with the button held).

With automatic phase this is never authoritative — the legacy inference cannot tell a drag tick from a release — so callers on the legacy path keep using is_down directly.

◆ isMainModifier()

bool pulp::view::MouseEvent::isMainModifier ( ) const
inline

◆ isMetaDown()

bool pulp::view::MouseEvent::isMetaDown ( ) const
inline

◆ isPen()

bool pulp::view::MouseEvent::isPen ( ) const
inline

◆ isPress()

bool pulp::view::MouseEvent::isPress ( ) const
inline

True for the initial button-down that begins a gesture.

◆ isPrimary()

bool pulp::view::MouseEvent::isPrimary ( ) const
inline

◆ isRelease()

bool pulp::view::MouseEvent::isRelease ( ) const
inline

True for the button-up that ends a gesture.

◆ isShiftDown()

bool pulp::view::MouseEvent::isShiftDown ( ) const
inline

◆ isTouch()

bool pulp::view::MouseEvent::isTouch ( ) const
inline

◆ isWheel()

bool pulp::view::MouseEvent::isWheel ( ) const
inline

◆ pointerTypeString()

const char * pulp::view::MouseEvent::pointerTypeString ( ) const
inline

W3C pointerType string.

Member Data Documentation

◆ altitude_angle

float pulp::view::MouseEvent::altitude_angle = 0

Stylus tilt in radians (0 = perpendicular).

◆ azimuth_angle

float pulp::view::MouseEvent::azimuth_angle = 0

Stylus rotation in radians (0–2π).

◆ button

MouseButton pulp::view::MouseEvent::button = MouseButton::left

◆ click_count

int pulp::view::MouseEvent::click_count = 1

1=single, 2=double, 3=triple click

◆ has_movement_delta

bool pulp::view::MouseEvent::has_movement_delta = false

Movement fields came from the native host.

◆ is_cancelled

bool pulp::view::MouseEvent::is_cancelled = false

True for touchesCancelled (→ pointercancel).

◆ is_down

bool pulp::view::MouseEvent::is_down = false

True for mouse-down / touch-began events.

◆ is_wheel

bool pulp::view::MouseEvent::is_wheel = false

True for scroll wheel events.

◆ modifiers

uint16_t pulp::view::MouseEvent::modifiers = 0

Bitfield of Modifier flags.

◆ movement_x

float pulp::view::MouseEvent::movement_x = 0

Host-reported horizontal movement since the prior event.

◆ movement_y

float pulp::view::MouseEvent::movement_y = 0

Host-reported vertical movement since the prior event.

◆ phase

MousePhase pulp::view::MouseEvent::phase = MousePhase::automatic

Explicit gesture phase (see MousePhase).

◆ pointer_id

int pulp::view::MouseEvent::pointer_id = 0

0 = primary, >0 = additional touches (multi-touch)

◆ pointer_type

PointerType pulp::view::MouseEvent::pointer_type = PointerType::mouse

◆ position

Point pulp::view::MouseEvent::position

Position in local view coordinates.

◆ pressure

float pulp::view::MouseEvent::pressure = 0.5f

0.0–1.0 (0.5 = default for mouse)

◆ scroll_delta_x

float pulp::view::MouseEvent::scroll_delta_x = 0

Horizontal scroll delta (positive = right).

◆ scroll_delta_y

float pulp::view::MouseEvent::scroll_delta_y = 0

Vertical scroll delta (positive = down).

◆ window_position

Point pulp::view::MouseEvent::window_position

Position in window coordinates.


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