ezEngine  Release 25.03
ezEditorInputContext Class Referenceabstract
Inheritance diagram for ezEditorInputContext:

Public Types

enum  MouseMode { MouseMode::Normal, MouseMode::WrapAtScreenBorders, MouseMode::HideAndWrapAtScreenBorders }
 How the mouse position is updated when the mouse cursor reaches the screen borders. More...
 

Public Member Functions

void FocusLost (bool bCancel)
 
ezEditorInput KeyPressEvent (QKeyEvent *e)
 
ezEditorInput KeyReleaseEvent (QKeyEvent *e)
 
ezEditorInput MousePressEvent (QMouseEvent *e)
 
ezEditorInput MouseReleaseEvent (QMouseEvent *e)
 
ezEditorInput MouseMoveEvent (QMouseEvent *e)
 
ezEditorInput WheelEvent (QWheelEvent *e)
 
void MakeActiveInputContext (bool bActive=true)
 
bool IsActiveInputContext () const
 
void SetOwner (ezQtEngineDocumentWindow *pOwnerWindow, ezQtEngineViewWidget *pOwnerView)
 
ezQtEngineDocumentWindowGetOwnerWindow () const
 
ezQtEngineViewWidgetGetOwnerView () const
 
bool GetShortcutsDisabled () const
 
void SetShortcutsDisabled (bool bDisabled)
 If set to true, the surrounding window will ensure to block all shortcuts and instead send keypress events to the input context.
 
virtual bool IsPickingSelectedAllowed () const
 
ezVec2I32 SetMouseMode (MouseMode mode)
 Sets how the mouse will act when it reaches the screen border. UpdateMouseMode() must be called on every mouseMoveEvent to update the state. More...
 
ezVec2I32 UpdateMouseMode (QMouseEvent *e)
 Updates the mouse position. Can always be called but will only have an effect if SetMouseMode() was called with one of the wrap modes. More...
 
virtual void UpdateStatusBarText (ezQtEngineDocumentWindow *pWindow)
 
- Public Member Functions inherited from ezReflectedClass
virtual const ezRTTIGetDynamicRTTI () const
 
bool IsInstanceOf (const ezRTTI *pType) const
 Returns whether the type of this instance is of the given type or derived from it.
 
template<typename T >
EZ_ALWAYS_INLINE bool IsInstanceOf () const
 Returns whether the type of this instance is of the given type or derived from it.
 

Static Public Member Functions

static void SetActiveInputContext (ezEditorInputContext *pContext)
 
static bool IsAnyInputContextActive ()
 
static ezEditorInputContextGetActiveInputContext ()
 
static void UpdateActiveInputContext ()
 
- Static Public Member Functions inherited from ezNoBase
static const ezRTTIGetStaticRTTI ()
 

Protected Member Functions

virtual void DoFocusLost (bool bCancel)
 
virtual void OnSetOwner (ezQtEngineDocumentWindow *pOwnerWindow, ezQtEngineViewWidget *pOwnerView)=0
 
virtual void OnActivated ()
 
virtual void OnDeactivated ()
 
virtual ezEditorInput DoKeyPressEvent (QKeyEvent *e)
 
virtual ezEditorInput DoKeyReleaseEvent (QKeyEvent *e)
 
virtual ezEditorInput DoMousePressEvent (QMouseEvent *e)
 
virtual ezEditorInput DoMouseReleaseEvent (QMouseEvent *e)
 
virtual ezEditorInput DoMouseMoveEvent (QMouseEvent *e)
 
virtual ezEditorInput DoWheelEvent (QWheelEvent *e)
 

Member Enumeration Documentation

◆ MouseMode

How the mouse position is updated when the mouse cursor reaches the screen borders.

Enumerator
Normal 

Nothing happens, the mouse will stop at screen borders as usual.

WrapAtScreenBorders 

The mouse is visibly wrapped at screen borders. When this mode is disabled, the mouse stays where it is.

HideAndWrapAtScreenBorders 

The mouse is wrapped at screen borders, which enables infinite movement, but the cursor is invisible. When this mode is disabled the mouse is restored to the position where it was when it was enabled.

Member Function Documentation

◆ SetMouseMode()

ezVec2I32 ezEditorInputContext::SetMouseMode ( MouseMode  mode)

Sets how the mouse will act when it reaches the screen border. UpdateMouseMode() must be called on every mouseMoveEvent to update the state.

The return value is the current global mouse position. Can be used to initialize a 'Last Mouse Position' variable.

◆ UpdateMouseMode()

ezVec2I32 ezEditorInputContext::UpdateMouseMode ( QMouseEvent *  e)

Updates the mouse position. Can always be called but will only have an effect if SetMouseMode() was called with one of the wrap modes.

Returns the new global mouse position, which may change drastically if the mouse cursor needed to be wrapped around the screen. Should be used to update a "Last Mouse Position" variable.


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