Gamp v0.0.7-36-g24b1eb6
Gamp: Graphics, Audio, Multimedia and Processing
Loading...
Searching...
No Matches
gamp::wt::event::InputEvent Class Reference

#include <Event.hpp>

Inheritance diagram for gamp::wt::event::InputEvent:
Collaboration diagram for gamp::wt::event::InputEvent:

Public Member Functions

 InputEvent (uint16_t type, const jau::fraction_timespec &when, const WindowRef &source, InputModifier mods) noexcept
 
constexpr int buttonDownCount () const noexcept
 Returns the number of pressed buttons by counting the set bits:
 
std::vector< InputButtonbuttonsDown () const
 See also MouseEvent's section about Multiple-Pointer Events.
 
constexpr bool has_any (InputModifier bits) const noexcept
 Use with groups of bits / mask, e.g.
 
constexpr bool is_set (InputModifier bits) const noexcept
 Use with single bits, e.g.
 
constexpr bool isAltDown () const noexcept
 Returns true if modifier() contains InputModifier::alt.
 
constexpr bool isAnyButtonDown () const noexcept
 Returns true if at least one button is pressed, otherwise false:
 
constexpr bool isAutorepeat () const noexcept
 Returns true if modifier() contains InputModifier::autorepeat.
 
constexpr bool isButtonDown (InputButton button) const noexcept
 See also MouseEvent's section about Multiple-Pointer Events.
 
constexpr bool isConfined () const noexcept
 Returns true if modifier() contains InputModifier::confined.
 
constexpr bool isControlDown () const noexcept
 Returns true if modifier() contains InputModifier::ctrl.
 
constexpr bool isInvisible () const noexcept
 Returns true if modifier() contains InputModifier::invisible.
 
constexpr bool isMetaDown () const noexcept
 Returns true if modifier() contains InputModifier::meta.
 
constexpr bool isShiftDown () const noexcept
 Returns true if modifier() contains InputModifier::shift.
 
constexpr InputModifier modifier () const noexcept
 
std::string toString () const noexcept
 
- Public Member Functions inherited from gamp::wt::event::WTEvent
 WTEvent (uint16_t type, const jau::fraction_timespec &when, const WindowRef &source) noexcept
 
constexpr bool consumed () const noexcept
 Consumed events will stop traversing through listener.
 
constexpr void setConsumed (bool v) noexcept
 Consumed events will stop traversing through listener.
 
constexpr const WindowWeakPtrsource () const noexcept
 
std::string toString () const noexcept
 
constexpr uint16_t type () const noexcept
 
constexpr const jau::fraction_timespecwhen () const noexcept
 

Static Public Member Functions

static constexpr InputModifier buttonMask (InputButton button) noexcept
 Returns the corresponding button mask for the given button.
 

Detailed Description

Definition at line 188 of file Event.hpp.

Constructor & Destructor Documentation

◆ InputEvent()

gamp::wt::event::InputEvent::InputEvent ( uint16_t type,
const jau::fraction_timespec & when,
const WindowRef & source,
InputModifier mods )
inlinenoexcept

Definition at line 207 of file Event.hpp.

Here is the caller graph for this function:

Member Function Documentation

◆ buttonMask()

static constexpr InputModifier gamp::wt::event::InputEvent::buttonMask ( InputButton button)
inlinestaticconstexprnoexcept

Returns the corresponding button mask for the given button.

In case the given button lies outside of the valid range [InputButton::button1 .. InputButton::button16], InputModifier::none is returned.

Definition at line 200 of file Event.hpp.

Here is the caller graph for this function:

◆ modifier()

InputModifier gamp::wt::event::InputEvent::modifier ( ) const
inlineconstexprnoexcept

Definition at line 210 of file Event.hpp.

Here is the caller graph for this function:

◆ is_set()

bool gamp::wt::event::InputEvent::is_set ( InputModifier bits) const
inlineconstexprnoexcept

Use with single bits, e.g.

InputModifier::lshift etc

Definition at line 213 of file Event.hpp.

Here is the caller graph for this function:

◆ has_any()

bool gamp::wt::event::InputEvent::has_any ( InputModifier bits) const
inlineconstexprnoexcept

Use with groups of bits / mask, e.g.

InputModifier::shift etc

Definition at line 215 of file Event.hpp.

Here is the caller graph for this function:

◆ isButtonDown()

bool gamp::wt::event::InputEvent::isButtonDown ( InputButton button) const
inlineconstexprnoexcept

See also MouseEvent's section about Multiple-Pointer Events.

Parameters
buttonthe button to test
Returns
true if the given button is down

Definition at line 222 of file Event.hpp.

Here is the caller graph for this function:

◆ buttonDownCount()

int gamp::wt::event::InputEvent::buttonDownCount ( ) const
inlineconstexprnoexcept

Returns the number of pressed buttons by counting the set bits:

    jau::ct_bit_count(modifier() & InputModifier::button_all);

See also MouseEvent's section about Multiple-Pointer Events.

See also
InputModifier::button_all

Definition at line 236 of file Event.hpp.

Here is the caller graph for this function:

◆ isAnyButtonDown()

bool gamp::wt::event::InputEvent::isAnyButtonDown ( ) const
inlineconstexprnoexcept

Returns true if at least one button is pressed, otherwise false:

    0 != ( modifier() & InputModifier::button_all )

See also MouseEvent's section about Multiple-Pointer Events.

See also
InputModifier::button_all

Definition at line 250 of file Event.hpp.

◆ buttonsDown()

std::vector< InputButton > gamp::wt::event::InputEvent::buttonsDown ( ) const
inline

See also MouseEvent's section about Multiple-Pointer Events.

Returns
List of pressed mouse buttons [InputButton::button1 .. InputButton::button16]. If none is down, the resulting list is of length 0.

Definition at line 258 of file Event.hpp.

◆ isAltDown()

bool gamp::wt::event::InputEvent::isAltDown ( ) const
inlineconstexprnoexcept

Returns true if modifier() contains InputModifier::alt.

Definition at line 273 of file Event.hpp.

◆ isControlDown()

bool gamp::wt::event::InputEvent::isControlDown ( ) const
inlineconstexprnoexcept

Returns true if modifier() contains InputModifier::ctrl.

Examples
GearsES2.cpp.

Definition at line 277 of file Event.hpp.

Here is the caller graph for this function:

◆ isMetaDown()

bool gamp::wt::event::InputEvent::isMetaDown ( ) const
inlineconstexprnoexcept

Returns true if modifier() contains InputModifier::meta.

Definition at line 281 of file Event.hpp.

◆ isShiftDown()

bool gamp::wt::event::InputEvent::isShiftDown ( ) const
inlineconstexprnoexcept

Returns true if modifier() contains InputModifier::shift.

Examples
GearsES2.cpp.

Definition at line 285 of file Event.hpp.

Here is the caller graph for this function:

◆ isAutorepeat()

bool gamp::wt::event::InputEvent::isAutorepeat ( ) const
inlineconstexprnoexcept

Returns true if modifier() contains InputModifier::autorepeat.

Definition at line 289 of file Event.hpp.

◆ isConfined()

bool gamp::wt::event::InputEvent::isConfined ( ) const
inlineconstexprnoexcept

Returns true if modifier() contains InputModifier::confined.

Definition at line 294 of file Event.hpp.

◆ isInvisible()

bool gamp::wt::event::InputEvent::isInvisible ( ) const
inlineconstexprnoexcept

Returns true if modifier() contains InputModifier::invisible.

Definition at line 298 of file Event.hpp.

◆ toString()

std::string gamp::wt::event::InputEvent::toString ( ) const
inlinenoexcept

Definition at line 302 of file Event.hpp.

Here is the caller graph for this function:

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