XII Release 0.1.0
Loading...
Searching...
No Matches
xiiInputDeviceMouseKeyboard Class Referenceabstract

#include <MouseKeyboard.h>

Inheritance diagram for xiiInputDeviceMouseKeyboard:
[legend]

Public Member Functions

virtual void SetShowMouseCursor (bool bShow)=0
 Shows or hides the mouse cursor inside the application window.
virtual bool GetShowMouseCursor () const =0
 Returns whether the mouse cursor is shown.
virtual void SetClipMouseCursor (xiiMouseCursorClipMode::Enum mode)=0
virtual xiiMouseCursorClipMode::Enum GetClipMouseCursor () const =0
 Returns whether the mouse is confined to the application window or not.
virtual void SetMouseSpeed (const xiiVec2 &vScale)
 Sets the scaling factor that is applied on all (relative) mouse input.
xiiVec2 GetMouseSpeed () const
 Returns the scaling factor that is applied on all (relative) mouse input.
bool IsFocused ()
 Returns if the associated xiiWindow has focus.
Public Member Functions inherited from xiiInputDevice
 xiiInputDevice ()
 Default Constructor.
float GetInputSlotState (xiiStringView sSlot) const
 Allows to query current input values for the given slot.
bool HasDeviceBeenUsedLastFrame () const
Public Member Functions inherited from xiiReflectedClass
virtual const xiiRTTI * GetDynamicRTTI () 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 xiiInt32 GetWindowNumberMouseIsOver ()
 Returns the number of the xiiWindow over which the mouse moved last.
Static Public Member Functions inherited from xiiNoBase
static const xiiRTTI * GetStaticRTTI ()

Protected Member Functions

virtual void UpdateInputSlotValues () override
Protected Member Functions inherited from xiiInputDevice
virtual void InitializeDevice ()=0
 Override this if you need to do device specific initialization before the first use.
virtual void ResetInputSlotValues ()
virtual void RegisterInputSlots ()=0
virtual void UpdateHardwareState (xiiTime tTimeDifference)

Protected Attributes

xiiTime m_DoubleClickTime = xiiTime::MakeFromMilliseconds(500)
Protected Attributes inherited from xiiInputDevice
xiiMap< xiiString, float > m_InputSlotValues
xiiUInt32 m_uiLastCharacter
Protected Attributes inherited from xiiEnumerable< xiiInputDevice, xiiReflectedClass >
xiiEnumerable * m_pNextInstance

Static Protected Attributes

static xiiInt32 s_iMouseIsOverWindowNumber = -1

Additional Inherited Members

Static Protected Member Functions inherited from xiiInputDevice
static void RegisterInputSlot (xiiStringView sName, xiiStringView sDefaultDisplayName, xiiBitflags< xiiInputSlotFlags > SlotFlags)
 Calls RegisterInputSlot() on the xiiInputManager and passes the parameters through.

Detailed Description

This is the base class for all input devices that handle mouse and keyboard input.

This class is derived from xiiInputDevice but adds interface functions to handle mouse and keyboard input.

Member Function Documentation

◆ SetClipMouseCursor()

virtual void xiiInputDeviceMouseKeyboard::SetClipMouseCursor ( xiiMouseCursorClipMode::Enum mode)
pure virtual

Will trap the mouse inside the application window. Should usually be enabled, to prevent accidental task switches.

Especially on multi-monitor systems, the mouse can easily leave the application window (even in fullscreen mode). Do NOT use this function when you have multiple windows and require absolute mouse positions.

See also
xiiMouseCursorClipMode

◆ UpdateInputSlotValues()

void xiiInputDeviceMouseKeyboard::UpdateInputSlotValues ( )
overrideprotectedvirtual

Override this, if you need to query the state of the hardware to update the input slots.

Note
This function might be called multiple times before ResetInputSlotValues() is called. This will be the case when xiiInputManager::PollHardware is used to make more frequent hardware updates than input is actually processed. Just make sure to always accumulate delta values (such as mouse move values) and don't expect ResetInputSlotValues() to be called in tandem with this function and it will be fine.

Implements xiiInputDevice.


The documentation for this class was generated from the following files:
  • /home/runner/work/XII/XII/Source/Engine/Core/Input/DeviceTypes/MouseKeyboard.h
  • /home/runner/work/XII/XII/Source/Engine/Core/Input/DeviceTypes/Implementation/DeviceTypes.cpp