ImFusion SDK 4.3
ContextMenuEvent Class Referencefinal

#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...

+ Inheritance diagram for ContextMenuEvent:

Detailed Description

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.
 
- Public Member Functions inherited from InputEvent
 InputEvent (Flags< KeyboardModifier > modifiers, LocalToGlobalCoordMapping mappingFunction=nullptr)
 Constructor for the InputEvent base class.
 
const KeyEventasKeyEvent () const
 Convenience function to dynamic_cast this instance to a KeyEvent.
 
const MouseEventasMouseEvent () const
 Convenience function to dynamic_cast this instance to a MouseEvent.
 
const TouchEventasTouchEvent () const
 Convenience function to dynamic_cast this instance to a TouchEvent.
 
const ContextMenuEventasContextMenuEvent () 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 LocalToGlobalCoordMappinglocalToGlobalMappingFunction () const
 

Additional Inherited Members

- Public Types inherited from InputEvent
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.
 
- Protected Attributes inherited from InputEvent
Flags< KeyboardModifierm_modifiers = KeyboardModifier::None
 
LocalToGlobalCoordMapping m_localToGlobalMappingFunction
 

Constructor & Destructor Documentation

◆ ContextMenuEvent()

ContextMenuEvent ( const vec2 & position,
Flags< KeyboardModifier > modifiers = KeyboardModifier::None,
LocalToGlobalCoordMapping mappingFunction = nullptr )

Constructor for a ContextMenuEvent.

Parameters
positionPosition of the mouse pointer wrt. the main GUI element enabling receiver to infer the context.
modifiersList of pressed keyboard modifier keys.
mappingFunctionOptional 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.

The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close