XII Release 0.1.0
Loading...
Searching...
No Matches
xiiEditorInputContext Class Referenceabstract
Inheritance diagram for xiiEditorInputContext:
[legend]

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)
 
xiiEditorInput KeyPressEvent (QKeyEvent *e)
 
xiiEditorInput KeyReleaseEvent (QKeyEvent *e)
 
xiiEditorInput MousePressEvent (QMouseEvent *e)
 
xiiEditorInput MouseReleaseEvent (QMouseEvent *e)
 
xiiEditorInput MouseMoveEvent (QMouseEvent *e)
 
xiiEditorInput WheelEvent (QWheelEvent *e)
 
void MakeActiveInputContext (bool bActive=true)
 
bool IsActiveInputContext () const
 
void SetOwner (xiiQtEngineDocumentWindow *pOwnerWindow, xiiQtEngineViewWidget *pOwnerView)
 
xiiQtEngineDocumentWindowGetOwnerWindow () const
 
xiiQtEngineViewWidgetGetOwnerView () 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
 
xiiVec2I32 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.
 
xiiVec2I32 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 (xiiQtEngineDocumentWindow *pWindow)
 
- Public Member Functions inherited from xiiReflectedClass
virtual const xiiRTTIGetDynamicRTTI () const
 
bool IsInstanceOf (const xiiRTTI *pType) const
 Returns whether the type of this instance is of the given type or derived from it.
 
template<typename T>
XII_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 (xiiEditorInputContext *pContext)
 
static bool IsAnyInputContextActive ()
 
static xiiEditorInputContextGetActiveInputContext ()
 
static void UpdateActiveInputContext ()
 
- Static Public Member Functions inherited from xiiNoBase
static const xiiRTTIGetStaticRTTI ()
 

Protected Member Functions

virtual void DoFocusLost (bool bCancel)
 
virtual void OnSetOwner (xiiQtEngineDocumentWindow *pOwnerWindow, xiiQtEngineViewWidget *pOwnerView)=0
 
virtual void OnActivated ()
 
virtual void OnDeactivated ()
 
virtual xiiEditorInput DoKeyPressEvent (QKeyEvent *e)
 
virtual xiiEditorInput DoKeyReleaseEvent (QKeyEvent *e)
 
virtual xiiEditorInput DoMousePressEvent (QMouseEvent *e)
 
virtual xiiEditorInput DoMouseReleaseEvent (QMouseEvent *e)
 
virtual xiiEditorInput DoMouseMoveEvent (QMouseEvent *e)
 
virtual xiiEditorInput 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()

xiiEditorInput xiiEditorInputContext::DoKeyPressEvent ( QKeyEvent * e)
protectedvirtual

Reimplemented in xiiSelectionContext.

◆ SetMouseMode()

xiiVec2I32 xiiEditorInputContext::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()

xiiVec2I32 xiiEditorInputContext::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: