|
utility 2026.1.9
A comprehensive C++ utilities library tailored for the development of modern desktop and extended reality (XR) applications.
|
Mouse button event. More...
#include <headers/utility/event/mouse_button_event.hpp>


Classes | |
| class | Factory |
| Factory for creating MouseButtonEvent instances. More... | |
Public Types | |
| enum class | Button : std::uint8_t { Unknown = 0 , Left = 1 , Middle = 2 , Right = 3 , X1 = 4 , X2 = 5 } |
| Mouse buttons enumeration. More... | |
| using | MousePosition = math::Vector2F |
Public Member Functions | |
| MouseButtonEvent (void) | |
| Default constructor. | |
| ~MouseButtonEvent (void) override | |
| Default destructor. | |
| MouseButtonEvent & | setPosition (const MousePosition &position) noexcept |
| Set the current mouse position. | |
| MousePosition | getPosition (void) const noexcept |
| Get the current mouse position. | |
| MouseButtonEvent & | setButton (const Button button) noexcept |
| Set the state of a mouse button. | |
| Button | getButton (void) const noexcept |
| Get the current mouse button. | |
| MouseButtonEvent & | setPressed (const bool pressed) noexcept |
| Set the pressed state of the button. | |
| bool | isButtonPressed (void) const noexcept |
| Get the pressed state of the button. | |
Public Member Functions inherited from utility::event::Event | |
| Event (void)=default | |
| Default constructor. | |
| virtual | ~Event (void)=default |
| Virtual destructor. | |
Mouse button event.
Represents mouse button presses/releases with position and button states.
Definition at line 41 of file mouse_button_event.hpp.
Type alias for mouse position as a 2D unsigned integer vector (x, y)
Definition at line 44 of file mouse_button_event.hpp.
|
strong |
Mouse buttons enumeration.
Definition at line 51 of file mouse_button_event.hpp.
|
noexcept |
Get the current mouse button.
Definition at line 64 of file mouse_button_event.cpp.
|
noexcept |
Get the current mouse position.
Definition at line 53 of file mouse_button_event.cpp.
|
noexcept |
Get the pressed state of the button.
Definition at line 75 of file mouse_button_event.cpp.
|
noexcept |
Set the state of a mouse button.
| button | The mouse button to set. |
Definition at line 58 of file mouse_button_event.cpp.
|
noexcept |
Set the current mouse position.
| position | The mouse position as a 2D vector (x, y). |
Definition at line 46 of file mouse_button_event.cpp.
|
noexcept |
Set the pressed state of the button.
| pressed | True if the button is pressed, false if released. |
Definition at line 69 of file mouse_button_event.cpp.