![]() |
ImFusion SDK 4.3
|
#include <ImFusion/GUI/InputEvent.h>
A ContextMenuEvent signals that a context-sensitive popup menu was requested by the user, for instance by a click with the right mouse button. More...
A ContextMenuEvent signals that a context-sensitive popup menu was requested by the user, for instance by a click with the right mouse button.
Receivers of this event should check if they should respond to it based on the position() and if so populate the contextMenu
field of the EventResult they return.
Public Member Functions | |
ContextMenuEvent (const vec2 &position, Flags< KeyboardModifier > modifiers=KeyboardModifier::None, LocalToGlobalCoordMapping mappingFunction=nullptr) | |
Constructor for a ContextMenuEvent. | |
const vec2 & | position () const |
Returns the position of the mouse pointer wrt. the main GUI element enabling receiver to infer the context. | |
![]() | |
InputEvent (Flags< KeyboardModifier > modifiers, LocalToGlobalCoordMapping mappingFunction=nullptr) | |
Constructor for the InputEvent base class. | |
const KeyEvent * | asKeyEvent () const |
Convenience function to dynamic_cast this instance to a KeyEvent. | |
const MouseEvent * | asMouseEvent () const |
Convenience function to dynamic_cast this instance to a MouseEvent. | |
const TouchEvent * | asTouchEvent () const |
Convenience function to dynamic_cast this instance to a TouchEvent. | |
const ContextMenuEvent * | asContextMenuEvent () const |
Convenience function to dynamic_cast this instance to a ContextMenuEvent. | |
const Flags< KeyboardModifier > & | modifiers () const |
Returns the list of pressed keyboard modifier keys. | |
vec2 | mapToGlobalCoord (const vec2 &localCoord) const |
Converts the given localCoord to the global coordinate system of the underlying windowing system if applicable. | |
const LocalToGlobalCoordMapping & | localToGlobalMappingFunction () const |
Additional Inherited Members | |
![]() | |
enum class | KeyboardModifier { None = 0 , Shift = 1 << 0 , Control = 1 << 1 , Alt = 1 << 2 , Meta = 1 << 3 } |
Bitfield enumeration to describe modifier keys on the keyboard. More... | |
using | LocalToGlobalCoordMapping = std::function<vec2(const vec2&)> |
Typedef for a function to map from event coordinates to global coordinates if applicable. | |
![]() | |
Flags< KeyboardModifier > | m_modifiers = KeyboardModifier::None |
LocalToGlobalCoordMapping | m_localToGlobalMappingFunction |
ContextMenuEvent | ( | const vec2 & | position, |
Flags< KeyboardModifier > | modifiers = KeyboardModifier::None, | ||
LocalToGlobalCoordMapping | mappingFunction = nullptr ) |
Constructor for a ContextMenuEvent.
position | Position of the mouse pointer wrt. the main GUI element enabling receiver to infer the context. |
modifiers | List of pressed keyboard modifier keys. |
mappingFunction | Optional mapping function used by mapToGlobalCoord() to convert event coordinates to global coordinates if the underlying windowing system supports it; mapToGlobalCoord() will use the identity function if empty. |