Plasma Engine  2.0
Loading...
Searching...
No Matches
plEditorInputContext Class Referenceabstract
Inheritance diagram for plEditorInputContext:

Public Types

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

Public Member Functions

void FocusLost (bool bCancel)
 
plEditorInput KeyPressEvent (QKeyEvent *e)
 
plEditorInput KeyReleaseEvent (QKeyEvent *e)
 
plEditorInput MousePressEvent (QMouseEvent *e)
 
plEditorInput MouseReleaseEvent (QMouseEvent *e)
 
plEditorInput MouseMoveEvent (QMouseEvent *e)
 
plEditorInput WheelEvent (QWheelEvent *e)
 
void MakeActiveInputContext (bool bActive=true)
 
bool IsActiveInputContext () const
 
void SetOwner (plQtEngineDocumentWindow *pOwnerWindow, plQtEngineViewWidget *pOwnerView)
 
plQtEngineDocumentWindowGetOwnerWindow () const
 
plQtEngineViewWidgetGetOwnerView () 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
 
plVec2I32 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.
 
plVec2I32 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.
 
virtual void UpdateStatusBarText (plQtEngineDocumentWindow *pWindow)
 
- Public Member Functions inherited from plReflectedClass
virtual const plRTTIGetDynamicRTTI () const
 
bool IsInstanceOf (const plRTTI *pType) const
 Returns whether the type of this instance is of the given type or derived from it.
 
template<typename T >
PL_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 (plEditorInputContext *pContext)
 
static bool IsAnyInputContextActive ()
 
static plEditorInputContextGetActiveInputContext ()
 
static void UpdateActiveInputContext ()
 
- Static Public Member Functions inherited from plNoBase
static const plRTTIGetStaticRTTI ()
 

Protected Member Functions

virtual void DoFocusLost (bool bCancel)
 
virtual void OnSetOwner (plQtEngineDocumentWindow *pOwnerWindow, plQtEngineViewWidget *pOwnerView)=0
 
virtual plEditorInput DoKeyPressEvent (QKeyEvent *e)
 
virtual plEditorInput DoKeyReleaseEvent (QKeyEvent *e)
 
virtual plEditorInput DoMousePressEvent (QMouseEvent *e)
 
virtual plEditorInput DoMouseReleaseEvent (QMouseEvent *e)
 
virtual plEditorInput DoMouseMoveEvent (QMouseEvent *e)
 
virtual plEditorInput 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

◆ DoKeyPressEvent()

plEditorInput plEditorInputContext::DoKeyPressEvent ( QKeyEvent * e)
protectedvirtual

Reimplemented in plSelectionContext.

◆ SetMouseMode()

plVec2I32 plEditorInputContext::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()

plVec2I32 plEditorInputContext::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: