Nui
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Nui::WebApi::MouseEvent Class Reference

A mouse event class. More...

#include <mouse_event.hpp>

Inheritance diagram for Nui::WebApi::MouseEvent:
Inheritance graph
[legend]
Collaboration diagram for Nui::WebApi::MouseEvent:
Collaboration graph
[legend]

Public Member Functions

 MouseEvent (Nui::val event)
 
bool altKey () const
 Returns a boolean value that is true if the Alt (Option or ⌥ on macOS) key was active when the key event was generated.
 
int button () const
 The button number that was pressed or released (if applicable) when the mouse event was fired.
 
int buttons () const
 The buttons being pressed (if any) when the mouse event was fired.
 
double clientX () const
 The X coordinate of the mouse pointer in viewport coordinates.
 
double clientY () const
 The Y coordinate of the mouse pointer in viewport coordinates.
 
double x () const
 The X coordinate of the mouse pointer in viewport coordinates.
 
double y () const
 The Y coordinate of the mouse pointer in viewport coordinates.
 
double movementX () const
 The X coordinate of the mouse pointer relative to the position of the last mousemove event.
 
double movementY () const
 The Y coordinate of the mouse pointer relative to the position of the last mousemove event.
 
double offsetX () const
 The X coordinate of the mouse pointer relative to the position of the padding edge of the target node.
 
double offsetY () const
 The Y coordinate of the mouse pointer relative to the position of the padding edge of the target node.
 
double pageX () const
 The X coordinate of the mouse pointer relative to the whole document.
 
double pageY () const
 The Y coordinate of the mouse pointer relative to the whole document.
 
double screenX () const
 The X coordinate of the mouse pointer in screen coordinates.
 
double screenY () const
 The Y coordinate of the mouse pointer in screen coordinates.
 
bool ctrlKey () const
 Returns a boolean value that is true if the Ctrl key was active when the key event was generated.
 
bool shiftKey () const
 Returns a boolean value that is true if the Shift key was active when the key event was generated.
 
bool metaKey () const
 Returns a boolean value that is true if the Meta key (on Mac keyboards, the ⌘ Command key; on Windows keyboards, the Windows key (⊞)) was active when the key event was generated.
 
std::optional< Nui::valrelatedTarget () const
 The secondary target for the event, if there is one.
 
- Public Member Functions inherited from Nui::WebApi::UiEvent
 UiEvent (Nui::val event)
 
long detail () const
 
Nui::val sourceCapabilities () const
 
Nui::val view () const
 
- Public Member Functions inherited from Nui::WebApi::Event
 Event (Nui::val event)
 
bool bubbles () const
 A boolean value indicating whether or not the event bubbles up through the DOM.
 
bool cancelable () const
 A boolean value indicating whether the event is cancelable.
 
bool composed () const
 A boolean indicating whether or not the event can bubble across the boundary between the shadow DOM and the regular DOM.
 
Nui::val currentTarget () const
 A reference to the currently registered target for the event.
 
bool defaultPrevented () const
 Indicates whether or not the call to event.preventDefault() canceled the event.
 
EventPhase eventPhase () const
 Indicates which phase of the event flow is being processed.
 
bool isTrusted () const
 Indicates whether or not the event was initiated by the browser (after a user click, for instance) or by a script (using an event creation method, for example).
 
Nui::val target () const
 A reference to the object to which the event was originally dispatched.
 
std::chrono::milliseconds timeStamp () const
 The time at which the event was created (in milliseconds).
 
std::string type () const
 The name identifying the type of the event, e.g., "click", "hashchange", or "submit".
 
std::vector< Nui::valcomposedPath () const
 The composedPath() method of the Event interface returns the event's path which is an array of the objects on which listeners will be invoked.
 
void preventDefault () const
 Cancels the event (if it is cancelable).
 
void stopImmediatePropagation () const
 For this particular event, prevent all other listeners from being called.
 
void stopPropagation () const
 Stops the propagation of events further along in the DOM.
 
- Public Member Functions inherited from Nui::ValWrapper
 ValWrapper (Nui::val valObject)
 
virtual ~ValWrapper ()=default
 
 ValWrapper (ValWrapper const &)=default
 
 ValWrapper (ValWrapper &&) noexcept=default
 
ValWrapperoperator= (ValWrapper const &)=default
 
ValWrapperoperator= (ValWrapper &&) noexcept=default
 
Nui::val const & val () const &noexcept
 
Nui::val val () &&noexcept
 
 operator Nui::val const & () const &noexcept
 
 operator Nui::val () &&noexcept
 

Additional Inherited Members

- Protected Attributes inherited from Nui::ValWrapper
Nui::val val_
 

Detailed Description

A mouse event class.

See also
https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent

Constructor & Destructor Documentation

◆ MouseEvent()

Nui::WebApi::MouseEvent::MouseEvent ( Nui::val  event)
explicit

Member Function Documentation

◆ altKey()

bool Nui::WebApi::MouseEvent::altKey ( ) const

Returns a boolean value that is true if the Alt (Option or ⌥ on macOS) key was active when the key event was generated.

◆ button()

int Nui::WebApi::MouseEvent::button ( ) const

The button number that was pressed or released (if applicable) when the mouse event was fired.

Returns
int

◆ buttons()

int Nui::WebApi::MouseEvent::buttons ( ) const

The buttons being pressed (if any) when the mouse event was fired.

Returns
int

◆ clientX()

double Nui::WebApi::MouseEvent::clientX ( ) const

The X coordinate of the mouse pointer in viewport coordinates.

See also
https://developer.mozilla.org/en-US/docs/Web/API/CSSOM_view_API/Coordinate_systems#viewport

◆ clientY()

double Nui::WebApi::MouseEvent::clientY ( ) const

The Y coordinate of the mouse pointer in viewport coordinates.

See also
https://developer.mozilla.org/en-US/docs/Web/API/CSSOM_view_API/Coordinate_systems#viewport

◆ ctrlKey()

bool Nui::WebApi::MouseEvent::ctrlKey ( ) const

Returns a boolean value that is true if the Ctrl key was active when the key event was generated.

◆ metaKey()

bool Nui::WebApi::MouseEvent::metaKey ( ) const

Returns a boolean value that is true if the Meta key (on Mac keyboards, the ⌘ Command key; on Windows keyboards, the Windows key (⊞)) was active when the key event was generated.

◆ movementX()

double Nui::WebApi::MouseEvent::movementX ( ) const

The X coordinate of the mouse pointer relative to the position of the last mousemove event.

◆ movementY()

double Nui::WebApi::MouseEvent::movementY ( ) const

The Y coordinate of the mouse pointer relative to the position of the last mousemove event.

◆ offsetX()

double Nui::WebApi::MouseEvent::offsetX ( ) const

The X coordinate of the mouse pointer relative to the position of the padding edge of the target node.

◆ offsetY()

double Nui::WebApi::MouseEvent::offsetY ( ) const

The Y coordinate of the mouse pointer relative to the position of the padding edge of the target node.

◆ pageX()

double Nui::WebApi::MouseEvent::pageX ( ) const

The X coordinate of the mouse pointer relative to the whole document.

◆ pageY()

double Nui::WebApi::MouseEvent::pageY ( ) const

The Y coordinate of the mouse pointer relative to the whole document.

◆ relatedTarget()

std::optional< Nui::val > Nui::WebApi::MouseEvent::relatedTarget ( ) const

The secondary target for the event, if there is one.

Returns
std::optional<Nui::val> nullopt, or a valid EventTarget object.

◆ screenX()

double Nui::WebApi::MouseEvent::screenX ( ) const

The X coordinate of the mouse pointer in screen coordinates.

See also
https://developer.mozilla.org/en-US/docs/Web/API/CSSOM_view_API/Coordinate_systems#screen

◆ screenY()

double Nui::WebApi::MouseEvent::screenY ( ) const

The Y coordinate of the mouse pointer in screen coordinates.

See also
https://developer.mozilla.org/en-US/docs/Web/API/CSSOM_view_API/Coordinate_systems#screen

◆ shiftKey()

bool Nui::WebApi::MouseEvent::shiftKey ( ) const

Returns a boolean value that is true if the Shift key was active when the key event was generated.

◆ x()

double Nui::WebApi::MouseEvent::x ( ) const

The X coordinate of the mouse pointer in viewport coordinates.

See also
https://developer.mozilla.org/en-US/docs/Web/API/CSSOM_view_API/Coordinate_systems#viewport

◆ y()

double Nui::WebApi::MouseEvent::y ( ) const

The Y coordinate of the mouse pointer in viewport coordinates.

See also
https://developer.mozilla.org/en-US/docs/Web/API/CSSOM_view_API/Coordinate_systems#viewport

The documentation for this class was generated from the following files: