psychic-ui 0.0.0
Loading...
Searching...
No Matches
psychic_ui::MouseEvent Struct Reference

#include <psychic-ui.hpp>

Public Attributes

float x {0}
float y {0}
float windowX {0}
float windowY {0}
MouseButton button {MouseButton::NONE}
bool down {false}
unsigned buttons {0}
Mod modifiers {}
unsigned clickCount {0}
InputMode source {InputMode::Pointer}
bool fromKeyboard {false}
double scrollX {0}
double scrollY {0}

Detailed Description

What every mouse signal passes (mousePressed, clicked, mouseScrolled, contextMenuRequested...), also made of touches (source is Touch), pens and keys (a keyboard click or context menu, clickCount 0). Each div gets it in its own coordinates: the window fills it in window coordinates and every div on the way moves x and y into its own.

Member Data Documentation

◆ button

MouseButton psychic_ui::MouseEvent::button {MouseButton::NONE}

The button that changed (press, release, button change, click, context menu); NONE for moves and scrolls

◆ buttons

unsigned psychic_ui::MouseEvent::buttons {0}

Every button held (MouseButton bits), after this change

◆ clickCount

unsigned psychic_ui::MouseEvent::clickCount {0}

Presses in a row of this button at this spot: 1, 2 for a double click, 3... Kept from the press for its release and click; 0 when no press made it (moves, scrolls, keyboard clicks and context menus)

◆ down

bool psychic_ui::MouseEvent::down {false}

Whether button went down, for mouseButtonChanged (true for presses, false for releases and clicks)

◆ fromKeyboard

bool psychic_ui::MouseEvent::fromKeyboard {false}

Made by a key in place of the mouse (Div::mouseEventAtCenter: a click by Enter or Space, a context menu by the Menu key or Shift+F10), so that what it opens can start at its first item, as from the keyboard

◆ scrollX

double psychic_ui::MouseEvent::scrollX {0}

How far the wheel turned, for mouseScrolled, in steps as SDL and GLFW report them (a positive scrollY is away from the user, scrolling up)

◆ source

InputMode psychic_ui::MouseEvent::source {InputMode::Pointer}

What made it: the mouse, a finger (the window's touch gestures) or a pen

◆ windowX

float psychic_ui::MouseEvent::windowX {0}

Where, in window coordinates, whichever div receives it

◆ x

float psychic_ui::MouseEvent::x {0}

Where, in the receiving div's content coordinates (those its children's x() and y() are in): from its top-left corner, plus how far it is scrolled


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