Pointer Events¶
-
enum PuglScrollDirection¶
Scroll direction.
Describes the direction of a
PuglScrollEventalong with whether the scroll is a “smooth” scroll. The discrete directions are for devices like mouse wheels with constrained axes, while a smooth scroll is for those with arbitrary scroll direction freedom, like some touchpads.-
enumerator PUGL_SCROLL_UP¶
Scroll up.
-
enumerator PUGL_SCROLL_DOWN¶
Scroll down.
-
enumerator PUGL_SCROLL_LEFT¶
Scroll left.
-
enumerator PUGL_SCROLL_RIGHT¶
Scroll right.
-
enumerator PUGL_SCROLL_SMOOTH¶
Smooth scroll in any direction.
-
enumerator PUGL_SCROLL_UP¶
-
struct PuglButtonEvent¶
Button press or release event.
Button numbers start from 0, and are ordered: primary, secondary, middle. So, on a typical right-handed mouse, the button numbers are:
Left: 0 Right: 1 Middle (often a wheel): 2
Higher button numbers are reported in the same order they are represented on the system. There is no universal standard here, but buttons 3 and 4 are typically a pair of buttons or a rocker, which are usually bound to “back” and “forward” operations.
Note that these numbers may differ from those used on the underlying platform, since they are manipulated to provide a consistent portable API.
-
PuglEventFlags flags¶
Bitwise OR of
PuglEventFlagvalues.
-
double time¶
Time in seconds.
-
double x¶
View-relative X coordinate.
-
double y¶
View-relative Y coordinate.
-
double xRoot¶
Root-relative X coordinate.
-
double yRoot¶
Root-relative Y coordinate.
-
uint32_t button¶
Button number starting from 0.
-
PuglEventFlags flags¶
-
struct PuglCrossingEvent¶
Pointer enter or leave event.
This is sent when the pointer enters or leaves the view. This can happen for several reasons (not just the user dragging the pointer over the window edge), as described by the
modefield.-
PuglEventFlags flags¶
Bitwise OR of
PuglEventFlagvalues.
-
double time¶
Time in seconds.
-
double x¶
View-relative X coordinate.
-
double y¶
View-relative Y coordinate.
-
double xRoot¶
Root-relative X coordinate.
-
double yRoot¶
Root-relative Y coordinate.
-
PuglCrossingMode mode¶
Reason for crossing.
-
PuglEventFlags flags¶
-
struct PuglMotionEvent¶
Pointer motion event.
-
PuglEventFlags flags¶
Bitwise OR of
PuglEventFlagvalues.
-
double time¶
Time in seconds.
-
double x¶
View-relative X coordinate.
-
double y¶
View-relative Y coordinate.
-
double xRoot¶
Root-relative X coordinate.
-
double yRoot¶
Root-relative Y coordinate.
-
PuglEventFlags flags¶
-
struct PuglScrollEvent¶
Scroll event.
The scroll distance is expressed in “lines”, an arbitrary unit that corresponds to a single tick of a detented mouse wheel. For example,
dy= 1.0 scrolls 1 line up. Some systems and devices support finer resolution and/or higher values for fast scrolls, so programs should handle any value gracefully.-
PuglEventFlags flags¶
Bitwise OR of
PuglEventFlagvalues.
-
double time¶
Time in seconds.
-
double x¶
View-relative X coordinate.
-
double y¶
View-relative Y coordinate.
-
double xRoot¶
Root-relative X coordinate.
-
double yRoot¶
Root-relative Y coordinate.
-
PuglScrollDirection direction¶
Scroll direction.
-
double dx¶
Scroll X distance in lines.
-
double dy¶
Scroll Y distance in lines.
-
PuglEventFlags flags¶