Plasma Engine  2.0
Loading...
Searching...
No Matches
plStandardInputDevice Class Reference

Android standard input device. More...

#include <InputDevice_android.h>

Inheritance diagram for plStandardInputDevice:

Public Member Functions

 plStandardInputDevice (plUInt32 uiWindowNumber)
 
virtual void SetShowMouseCursor (bool bShow) override
 Shows or hides the mouse cursor inside the application window.
 
virtual bool GetShowMouseCursor () const override
 Returns whether the mouse cursor is shown.
 
virtual void SetClipMouseCursor (plMouseCursorClipMode::Enum mode) override
 Will trap the mouse inside the application window. Should usually be enabled, to prevent accidental task switches.
 
virtual plMouseCursorClipMode::Enum GetClipMouseCursor () const override
 Returns whether the mouse is confined to the application window or not.
 
 plStandardInputDevice (plUInt32 uiWindowNumber, GLFWwindow *windowHandle)
 
virtual void SetShowMouseCursor (bool bShow) override
 Shows or hides the mouse cursor inside the application window.
 
virtual bool GetShowMouseCursor () const override
 Returns whether the mouse cursor is shown.
 
virtual void SetClipMouseCursor (plMouseCursorClipMode::Enum mode) override
 Will trap the mouse inside the application window. Should usually be enabled, to prevent accidental task switches.
 
virtual plMouseCursorClipMode::Enum GetClipMouseCursor () const override
 Returns whether the mouse is confined to the application window or not.
 
void OnKey (int key, int scancode, int action, int mods)
 
void OnCharacter (unsigned int codepoint)
 
void OnCursorPosition (double xpos, double ypos)
 
void OnMouseButton (int button, int action, int mods)
 
void OnScroll (double xoffset, double yoffset)
 
 plStandardInputDevice (plUInt32 uiWindowNumber)
 
virtual void SetShowMouseCursor (bool bShow) override
 Shows or hides the mouse cursor inside the application window.
 
virtual bool GetShowMouseCursor () const override
 Returns whether the mouse cursor is shown.
 
virtual void SetClipMouseCursor (plMouseCursorClipMode::Enum mode) override
 Will trap the mouse inside the application window. Should usually be enabled, to prevent accidental task switches.
 
virtual plMouseCursorClipMode::Enum GetClipMouseCursor () const override
 Returns whether the mouse is confined to the application window or not.
 
 plStandardInputDevice (ABI::Windows::UI::Core::ICoreWindow *coreWindow)
 
virtual void SetClipMouseCursor (plMouseCursorClipMode::Enum mode) override
 Will trap the mouse inside the application window. Should usually be enabled, to prevent accidental task switches.
 
virtual plMouseCursorClipMode::Enum GetClipMouseCursor () const override
 Returns whether the mouse is confined to the application window or not.
 
virtual void SetShowMouseCursor (bool bShow) override
 Shows or hides the mouse cursor inside the application window.
 
virtual bool GetShowMouseCursor () const override
 Returns whether the mouse cursor is shown.
 
 plStandardInputDevice (plUInt32 uiWindowNumber)
 
void WindowMessage (plMinWindows::HWND hWnd, plMinWindows::UINT msg, plMinWindows::WPARAM wparam, plMinWindows::LPARAM lparam)
 This function needs to be called by all Windows functions, to pass the input information through to this input device.
 
virtual void SetClipMouseCursor (plMouseCursorClipMode::Enum mode) override
 Will trap the mouse inside the application window. Should usually be enabled, to prevent accidental task switches.
 
virtual plMouseCursorClipMode::Enum GetClipMouseCursor () const override
 Returns whether the mouse is confined to the application window or not.
 
virtual void SetShowMouseCursor (bool bShow) override
 Shows or hides the mouse cursor inside the application window.
 
virtual bool GetShowMouseCursor () const override
 Returns whether the mouse cursor is shown.
 
- Public Member Functions inherited from plInputDeviceMouseKeyboard
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.
 
- Public Member Functions inherited from plInputDevice
 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.
 
- 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 LocalizeButtonDisplayNames ()
 Calling this function will 'translate' most key names from English to the OS language, by querying that information from the OS.
 
- Static Public Member Functions inherited from plInputDeviceMouseKeyboard
static plInt32 GetWindowNumberMouseIsOver ()
 Returns the number of the plWindow over which the mouse moved last.
 
- Static Public Member Functions inherited from plNoBase
static const plRTTIGetStaticRTTI ()
 

Protected Member Functions

virtual void InitializeDevice () override
 Override this if you need to do device specific initialization before the first use.
 
virtual void RegisterInputSlots () override
 Override this to register all the input slots that this device exposes.
 
virtual void ResetInputSlotValues () override
 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 UpdateInputSlotValues () override
 Override this, if you need to query the state of the hardware to update the input slots.
 
- Protected Member Functions inherited from plInputDevice
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.
 

Private Member Functions

virtual void InitializeDevice () override
 Override this if you need to do device specific initialization before the first use.
 
virtual void RegisterInputSlots () override
 Override this to register all the input slots that this device exposes.
 
virtual void ResetInputSlotValues () override
 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 InitializeDevice () override
 Override this if you need to do device specific initialization before the first use.
 
virtual void RegisterInputSlots () override
 Override this to register all the input slots that this device exposes.
 
virtual void ResetInputSlotValues () override
 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 InitializeDevice () override
 Override this if you need to do device specific initialization before the first use.
 
virtual void RegisterInputSlots () override
 Override this to register all the input slots that this device exposes.
 
virtual void InitializeDevice () override
 Override this if you need to do device specific initialization before the first use.
 
virtual void RegisterInputSlots () override
 Override this to register all the input slots that this device exposes.
 
virtual void ResetInputSlotValues () override
 Override this, if you need to reset certain input slot values to zero, after the plInputManager is finished with the current frame update.
 

Additional Inherited Members

- Static Protected Member Functions inherited from plInputDevice
static void RegisterInputSlot (plStringView sName, plStringView sDefaultDisplayName, plBitflags< plInputSlotFlags > SlotFlags)
 Calls RegisterInputSlot() on the plInputManager and passes the parameters through.
 
- Protected Attributes inherited from plInputDeviceMouseKeyboard
plTime m_DoubleClickTime = plTime::MakeFromMilliseconds(500)
 
- Protected Attributes inherited from plInputDevice
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.
 
- Protected Attributes inherited from plEnumerable< plInputDevice, plReflectedClass >
plEnumerablem_pNextInstance
 
- Static Protected Attributes inherited from plInputDeviceMouseKeyboard
static plInt32 s_iMouseIsOverWindowNumber = -1
 

Detailed Description

Android standard input device.

Member Function Documentation

◆ GetClipMouseCursor() [1/5]

plMouseCursorClipMode::Enum plStandardInputDevice::GetClipMouseCursor ( ) const
overridevirtual

Returns whether the mouse is confined to the application window or not.

Implements plInputDeviceMouseKeyboard.

◆ GetClipMouseCursor() [2/5]

virtual plMouseCursorClipMode::Enum plStandardInputDevice::GetClipMouseCursor ( ) const
overridevirtual

Returns whether the mouse is confined to the application window or not.

Implements plInputDeviceMouseKeyboard.

◆ GetClipMouseCursor() [3/5]

virtual plMouseCursorClipMode::Enum plStandardInputDevice::GetClipMouseCursor ( ) const
overridevirtual

Returns whether the mouse is confined to the application window or not.

Implements plInputDeviceMouseKeyboard.

◆ GetClipMouseCursor() [4/5]

virtual plMouseCursorClipMode::Enum plStandardInputDevice::GetClipMouseCursor ( ) const
inlineoverridevirtual

Returns whether the mouse is confined to the application window or not.

Implements plInputDeviceMouseKeyboard.

◆ GetClipMouseCursor() [5/5]

virtual plMouseCursorClipMode::Enum plStandardInputDevice::GetClipMouseCursor ( ) const
inlineoverridevirtual

Returns whether the mouse is confined to the application window or not.

Implements plInputDeviceMouseKeyboard.

◆ GetShowMouseCursor() [1/5]

bool plStandardInputDevice::GetShowMouseCursor ( ) const
overridevirtual

Returns whether the mouse cursor is shown.

Implements plInputDeviceMouseKeyboard.

◆ GetShowMouseCursor() [2/5]

virtual bool plStandardInputDevice::GetShowMouseCursor ( ) const
overridevirtual

Returns whether the mouse cursor is shown.

Implements plInputDeviceMouseKeyboard.

◆ GetShowMouseCursor() [3/5]

virtual bool plStandardInputDevice::GetShowMouseCursor ( ) const
overridevirtual

Returns whether the mouse cursor is shown.

Implements plInputDeviceMouseKeyboard.

◆ GetShowMouseCursor() [4/5]

virtual bool plStandardInputDevice::GetShowMouseCursor ( ) const
overridevirtual

Returns whether the mouse cursor is shown.

Implements plInputDeviceMouseKeyboard.

◆ GetShowMouseCursor() [5/5]

virtual bool plStandardInputDevice::GetShowMouseCursor ( ) const
overridevirtual

Returns whether the mouse cursor is shown.

Implements plInputDeviceMouseKeyboard.

◆ InitializeDevice() [1/5]

void plStandardInputDevice::InitializeDevice ( )
overrideprivatevirtual

Override this if you need to do device specific initialization before the first use.

Implements plInputDevice.

◆ InitializeDevice() [2/5]

virtual void plStandardInputDevice::InitializeDevice ( )
overrideprivatevirtual

Override this if you need to do device specific initialization before the first use.

Implements plInputDevice.

◆ InitializeDevice() [3/5]

virtual void plStandardInputDevice::InitializeDevice ( )
overrideprivatevirtual

Override this if you need to do device specific initialization before the first use.

Implements plInputDevice.

◆ InitializeDevice() [4/5]

virtual void plStandardInputDevice::InitializeDevice ( )
overrideprivatevirtual

Override this if you need to do device specific initialization before the first use.

Implements plInputDevice.

◆ InitializeDevice() [5/5]

virtual void plStandardInputDevice::InitializeDevice ( )
overrideprotectedvirtual

Override this if you need to do device specific initialization before the first use.

Implements plInputDevice.

◆ LocalizeButtonDisplayNames()

void plStandardInputDevice::LocalizeButtonDisplayNames ( )
static

Calling this function will 'translate' most key names from English to the OS language, by querying that information from the OS.

The OS translation might not always be perfect for all keys. The translation can change when the user changes the keyboard layout. So if he switches from an English layout to a German layout, LocalizeButtonDisplayNames() should be called again, to update the display names, if that is required.

◆ RegisterInputSlots() [1/5]

void plStandardInputDevice::RegisterInputSlots ( )
overrideprivatevirtual

Override this to register all the input slots that this device exposes.

This is called once during initialization. It needs to call RegisterInputSlot() once for every input slot that this device exposes to the system.

Implements plInputDevice.

◆ RegisterInputSlots() [2/5]

virtual void plStandardInputDevice::RegisterInputSlots ( )
overrideprivatevirtual

Override this to register all the input slots that this device exposes.

This is called once during initialization. It needs to call RegisterInputSlot() once for every input slot that this device exposes to the system.

Implements plInputDevice.

◆ RegisterInputSlots() [3/5]

virtual void plStandardInputDevice::RegisterInputSlots ( )
overrideprivatevirtual

Override this to register all the input slots that this device exposes.

This is called once during initialization. It needs to call RegisterInputSlot() once for every input slot that this device exposes to the system.

Implements plInputDevice.

◆ RegisterInputSlots() [4/5]

virtual void plStandardInputDevice::RegisterInputSlots ( )
overrideprivatevirtual

Override this to register all the input slots that this device exposes.

This is called once during initialization. It needs to call RegisterInputSlot() once for every input slot that this device exposes to the system.

Implements plInputDevice.

◆ RegisterInputSlots() [5/5]

virtual void plStandardInputDevice::RegisterInputSlots ( )
overrideprotectedvirtual

Override this to register all the input slots that this device exposes.

This is called once during initialization. It needs to call RegisterInputSlot() once for every input slot that this device exposes to the system.

Implements plInputDevice.

◆ ResetInputSlotValues() [1/4]

void plStandardInputDevice::ResetInputSlotValues ( )
overrideprivatevirtual

Override this, if you need to reset certain input slot values to zero, after the plInputManager is finished with the current frame update.

Reimplemented from plInputDevice.

◆ ResetInputSlotValues() [2/4]

virtual void plStandardInputDevice::ResetInputSlotValues ( )
overrideprivatevirtual

Override this, if you need to reset certain input slot values to zero, after the plInputManager is finished with the current frame update.

Reimplemented from plInputDevice.

◆ ResetInputSlotValues() [3/4]

virtual void plStandardInputDevice::ResetInputSlotValues ( )
overrideprivatevirtual

Override this, if you need to reset certain input slot values to zero, after the plInputManager is finished with the current frame update.

Reimplemented from plInputDevice.

◆ ResetInputSlotValues() [4/4]

virtual void plStandardInputDevice::ResetInputSlotValues ( )
overrideprotectedvirtual

Override this, if you need to reset certain input slot values to zero, after the plInputManager is finished with the current frame update.

Reimplemented from plInputDevice.

◆ SetClipMouseCursor() [1/5]

void plStandardInputDevice::SetClipMouseCursor ( plMouseCursorClipMode::Enum mode)
overridevirtual

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
plMouseCursorClipMode

Implements plInputDeviceMouseKeyboard.

◆ SetClipMouseCursor() [2/5]

virtual void plStandardInputDevice::SetClipMouseCursor ( plMouseCursorClipMode::Enum mode)
overridevirtual

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
plMouseCursorClipMode

Implements plInputDeviceMouseKeyboard.

◆ SetClipMouseCursor() [3/5]

virtual void plStandardInputDevice::SetClipMouseCursor ( plMouseCursorClipMode::Enum mode)
overridevirtual

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
plMouseCursorClipMode

Implements plInputDeviceMouseKeyboard.

◆ SetClipMouseCursor() [4/5]

virtual void plStandardInputDevice::SetClipMouseCursor ( plMouseCursorClipMode::Enum mode)
overridevirtual

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
plMouseCursorClipMode

Implements plInputDeviceMouseKeyboard.

◆ SetClipMouseCursor() [5/5]

virtual void plStandardInputDevice::SetClipMouseCursor ( plMouseCursorClipMode::Enum mode)
overridevirtual

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
plMouseCursorClipMode

Implements plInputDeviceMouseKeyboard.

◆ SetShowMouseCursor() [1/5]

void plStandardInputDevice::SetShowMouseCursor ( bool bShow)
overridevirtual

Shows or hides the mouse cursor inside the application window.

Implements plInputDeviceMouseKeyboard.

◆ SetShowMouseCursor() [2/5]

virtual void plStandardInputDevice::SetShowMouseCursor ( bool bShow)
overridevirtual

Shows or hides the mouse cursor inside the application window.

Implements plInputDeviceMouseKeyboard.

◆ SetShowMouseCursor() [3/5]

virtual void plStandardInputDevice::SetShowMouseCursor ( bool bShow)
overridevirtual

Shows or hides the mouse cursor inside the application window.

Implements plInputDeviceMouseKeyboard.

◆ SetShowMouseCursor() [4/5]

virtual void plStandardInputDevice::SetShowMouseCursor ( bool bShow)
overridevirtual

Shows or hides the mouse cursor inside the application window.

Implements plInputDeviceMouseKeyboard.

◆ SetShowMouseCursor() [5/5]

virtual void plStandardInputDevice::SetShowMouseCursor ( bool bShow)
overridevirtual

Shows or hides the mouse cursor inside the application window.

Implements plInputDeviceMouseKeyboard.

◆ UpdateInputSlotValues()

void plStandardInputDevice::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 plInputManager::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.

Reimplemented from plInputDeviceMouseKeyboard.


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