![]() |
Plasma Engine
2.0
|
This is the base class for all input devices that handle mouse and keyboard input. More...
#include <MouseKeyboard.h>
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 (plMouseCursorClipMode::Enum mode)=0 |
Will trap the mouse inside the application window. Should usually be enabled, to prevent accidental task switches. | |
virtual plMouseCursorClipMode::Enum | GetClipMouseCursor () const =0 |
Returns whether the mouse is confined to the application window or not. | |
virtual void | SetMouseSpeed (const plVec2 &vScale) |
Sets the scaling factor that is applied on all (relative) mouse input. | |
plVec2 | GetMouseSpeed () const |
Returns the scaling factor that is applied on all (relative) mouse input. | |
bool | IsFocused () |
Returns if the associated plWindow has focus. | |
![]() | |
plInputDevice () | |
Default Constructor. | |
float | GetInputSlotState (plStringView sSlot) const |
Allows to query current input values for the given slot. | |
bool | HasDeviceBeenUsedLastFrame () const |
Returns true, if the device was 'used' during the last frame, ie. when it generated input due to some user interaction. | |
![]() | |
virtual const plRTTI * | GetDynamicRTTI () 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 plInt32 | GetWindowNumberMouseIsOver () |
Returns the number of the plWindow over which the mouse moved last. | |
![]() | |
static const plRTTI * | GetStaticRTTI () |
Protected Member Functions | |
virtual void | UpdateInputSlotValues () override |
Override this, if you need to query the state of the hardware to update the input slots. | |
![]() | |
virtual void | InitializeDevice ()=0 |
Override this if you need to do device specific initialization before the first use. | |
virtual void | ResetInputSlotValues () |
Override this, if you need to reset certain input slot values to zero, after the plInputManager is finished with the current frame update. | |
virtual void | RegisterInputSlots ()=0 |
Override this to register all the input slots that this device exposes. | |
virtual void | UpdateHardwareState (plTime tTimeDifference) |
This function is called once after plInputManager::Update with the same time delta value. It allows to update hardware state, such as the vibration of gamepad motors. | |
Protected Attributes | |
plTime | m_DoubleClickTime = plTime::MakeFromMilliseconds(500) |
![]() | |
plMap< plString, float > | m_InputSlotValues |
Stores all the values for all input slots that this device handles. | |
plUInt32 | m_uiLastCharacter |
If this input device type handles character input, it should write the last typed character into this variable. The plInputManager calls RetrieveLastCharacter() to query what the user typed last. | |
![]() | |
plEnumerable * | m_pNextInstance |
Static Protected Attributes | |
static plInt32 | s_iMouseIsOverWindowNumber = -1 |
Additional Inherited Members | |
![]() | |
static void | RegisterInputSlot (plStringView sName, plStringView sDefaultDisplayName, plBitflags< plInputSlotFlags > SlotFlags) |
Calls RegisterInputSlot() on the plInputManager and passes the parameters through. | |
This is the base class for all input devices that handle mouse and keyboard input.
This class is derived from plInputDevice but adds interface functions to handle mouse and keyboard input.
|
pure virtual |
Returns whether the mouse is confined to the application window or not.
Implemented in plStandardInputDevice, plStandardInputDevice, plStandardInputDevice, plStandardInputDevice, and plStandardInputDevice.
|
pure virtual |
Returns whether the mouse cursor is shown.
Implemented in plStandardInputDevice, plStandardInputDevice, plStandardInputDevice, plStandardInputDevice, and plStandardInputDevice.
|
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.
Implemented in plStandardInputDevice, plStandardInputDevice, plStandardInputDevice, plStandardInputDevice, and plStandardInputDevice.
|
pure virtual |
Shows or hides the mouse cursor inside the application window.
Implemented in plStandardInputDevice, plStandardInputDevice, plStandardInputDevice, plStandardInputDevice, and plStandardInputDevice.
|
overrideprotectedvirtual |
Override this, if you need to query the state of the hardware to update the input slots.
Implements plInputDevice.
Reimplemented in plStandardInputDevice.