Axmol 3.0.0-89d6d9a
Loading...
Searching...
No Matches
PointerInputState Struct Reference

Internal representation of raw pointer input from the platform. More...

#include <Event.h>

Public Attributes

intptr_t id {-1}
 Unique identifier for the pointer (platform-provided or mapped).
float pressure {1.0f}
 Raw pressure value reported by the platform (if available).
int32_t button {InputButton::None}
 Triggering button index (0..n-1), or -1 when none (touch / no button).
uint32_t pressedButtons {0}
 Bitmask of currently pressed buttons; bit i corresponds to button index i.
PointerType type {PointerType::Mouse}
 Type of pointer (Mouse, Touch, Pen).

Detailed Description

Internal representation of raw pointer input from the platform.

This structure is used internally by the InputSystem to capture native input events (touch, mouse, pen, etc.) coming from the OS or windowing layer. Fields contain unprocessed, screen-space values and raw attributes such as pointer id, button index, pressed-button bitmask and pressure.

Note
Pointer id rules:
  • Touch / Pen: non-negative integer ids assigned per active contact by the platform.
  • Mouse: the identifier is set to 0.
Button semantics:
  • The button field is a single button index indicating which button triggered this event. It uses the convention:
    • -1 (InputButton::None) => no button triggered (e.g., touch or pure move)
    • 0..n-1 => button index (0 typically = left, 1 = right, 2 = middle)
  • For PointerMove events the button value MUST be -1.
  • Use pressedButtons to inspect the current set of pressed buttons.
pressedButtons bitmask:
  • Each bit corresponds to a button index: bit i represents whether button index i is currently pressed (1 = pressed, 0 = released).
  • Example:
    • bit 0 (1u << 0) => left button
    • bit 1 (1u << 1) => right button
    • bit 2 (1u << 2) => middle button
  • For touch events, pressedButtons is typically 0.
Coordinate / transform:
  • Values x and y are raw native screen-space coordinates. The InputSystem is responsible for applying input scaling and transforming these into engine/view coordinates before constructing and dispatching a higher-level PointerEvent to listeners.
Warning
This type is internal to the input pipeline and should not be exposed directly to user code or public APIs.

The documentation for this struct was generated from the following file:
  • Event.h