#include <InputDeviceMouse.h>
Inherits AzFramework::InputDevice, and InputSystemCursorRequestBus::Handler.
Classes | |
struct | Button |
class | Implementation |
Base class for platform specific implementations of mouse input devices. More... | |
struct | Movement |
Public Types | |
using | ImplementationFactory = Implementation *(InputDeviceMouse &) |
Alias for the function type used to create a custom implementation for this input device. | |
Public Member Functions | |
AZ_CLASS_ALLOCATOR (InputDeviceMouse, AZ::SystemAllocator) | |
AZ_RTTI (InputDeviceMouse, "{A509CA9D-BEAA-4124-9AAD-7381E46EBDD4}", InputDevice) | |
InputDeviceMouse (const InputDeviceId &inputDeviceId=Id, ImplementationFactory implementationFactory=&Implementation::Create) | |
AZ_DISABLE_COPY_MOVE (InputDeviceMouse) | |
~InputDeviceMouse () override | |
Destructor. | |
const InputChannelByIdMap & | GetInputChannelsById () const override |
AzFramework::InputDevice::GetInputChannelsById | |
bool | IsSupported () const override |
AzFramework::InputDevice::IsSupported | |
bool | IsConnected () const override |
AzFramework::InputDevice::IsConnected | |
void | TickInputDevice () override |
AzFramework::InputDeviceRequests::TickInputDevice | |
void | SetSystemCursorState (SystemCursorState systemCursorState) override |
AzFramework::InputSystemCursorRequests::SetSystemCursorState | |
SystemCursorState | GetSystemCursorState () const override |
AzFramework::InputSystemCursorRequests::GetSystemCursorState | |
void | SetSystemCursorPositionNormalized (AZ::Vector2 positionNormalized) override |
AzFramework::InputSystemCursorRequests::SetSystemCursorPositionNormalized | |
AZ::Vector2 | GetSystemCursorPositionNormalized () const override |
AzFramework::InputSystemCursorRequests::GetSystemCursorPositionNormalized | |
void | SetRawMovementSampleRate (AZ::u32 sampleRateHertz) |
void | SetImplementation (AZStd::unique_ptr< Implementation > impl) |
Public Member Functions inherited from AzFramework::InputDevice | |
AZ_CLASS_ALLOCATOR (InputDevice, AZ::SystemAllocator) | |
AZ_RTTI (InputDevice, "{29F9FB6B-15CB-4DB4-9F36-DE7396B82F3D}") | |
InputDevice (const InputDeviceId &inputDeviceId) | |
AZ_DISABLE_COPY_MOVE (InputDevice) | |
~InputDevice () override | |
Destructor. | |
const InputDevice * | GetInputDevice () const final |
AzFramework::InputDeviceRequests::GetInputDevice | |
const InputDeviceId & | GetInputDeviceId () const |
virtual LocalUserId | GetAssignedLocalUserId () const |
virtual void | PromptLocalUserSignIn () const |
virtual const InputChannelByIdMap & | GetInputChannelsById () const =0 |
virtual bool | IsSupported () const =0 |
virtual bool | IsConnected () const =0 |
Static Public Member Functions | |
static bool | IsMouseDevice (const InputDeviceId &inputDeviceId) |
static void | Reflect (AZ::ReflectContext *context) |
Static Public Member Functions inherited from AzFramework::InputDevice | |
static void | Reflect (AZ::ReflectContext *context) |
Static Public Attributes | |
static constexpr AZ::u32 | MovementSampleRateDefault {60} |
static constexpr AZ::u32 | MovementSampleRateQueueAll {std::numeric_limits<AZ::u32>::max()} |
static constexpr AZ::u32 | MovementSampleRateAccumulateAll {0} |
static constexpr InputDeviceId | Id {"mouse"} |
The id used to identify the primary mouse input device. | |
static constexpr InputChannelId | SystemCursorPosition {"mouse_system_cursor_position"} |
Protected Types | |
using | ButtonChannelByIdMap = AZStd::unordered_map< InputChannelId, InputChannelDigitalWithSharedPosition2D * > |
using | MovementChannelByIdMap = AZStd::unordered_map< InputChannelId, InputChannelDeltaWithSharedPosition2D * > |
Protected Attributes | |
InputChannelByIdMap | m_allChannelsById |
All mouse channels. | |
ButtonChannelByIdMap | m_buttonChannelsById |
Mouse button channels. | |
MovementChannelByIdMap | m_movementChannelsById |
Mouse movement channels. | |
InputChannelDeltaWithSharedPosition2D * | m_cursorPositionChannel |
Cursor position channel. | |
InputChannel::SharedPositionData2D | m_cursorPositionData2D |
Shared cursor position. | |
Additional Inherited Members | |
Protected Member Functions inherited from AzFramework::InputDevice | |
void | BroadcastInputChannelEvent (const InputChannel &inputChannel) const |
void | BroadcastInputTextEvent (const AZStd::string &textUTF8) const |
void | BroadcastInputDeviceConnectedEvent () const |
Broadcast an event when the input device connects to the system. | |
void | BroadcastInputDeviceDisconnectedEvent () const |
Broadcast an event when the input device disconnects from the system. | |
void | ResetInputChannelStates () |
Reset the state of all this input device's associated input channels. | |
Defines a generic mouse input device, including the ids of all its associated input channels. Platform specific implementations are defined as private implementations so that creating an instance of this generic class will work correctly on any platform that supports mouse input, while providing access to the device name and associated channel ids on any platform through the 'null' implementation (primarily so that the editor can use them to setup input mappings).
|
protected |
Alias for verbose container class
|
explicit |
Constructor
[in] | inputDeviceId | Optional override of the default input device id |
[in] | implementationFactory | Optional override of the default Implementation::Create |
|
overridevirtual |
|
overridevirtual |
|
static |
Check whether an input device id identifies a mouse (regardless of index)
[in] | inputDeviceId | The input device id to check |
|
overridevirtual |
|
inline |
Set the implementation of this input device
[in] | implementation | The new implementation |
void AzFramework::InputDeviceMouse::SetRawMovementSampleRate | ( | AZ::u32 | sampleRateHertz | ) |
Set the sample rate for raw mouse movement events
[in] | sampleRateHertz | The raw movement sample rate in Hertz (cycles per second) |
|
inlinestaticconstexpr |
Sample rate for raw mouse movement that will cause all events received in the same frame to be accumulated and dispatched as a single event. Optimal for performance, but results in sluggish/unresponsive mouse movement, especially when running at low frame rates.
|
inlinestaticconstexpr |
Default sample rate for raw mouse movement events that aims to strike a balance between responsiveness and performance.
|
inlinestaticconstexpr |
Sample rate for raw mouse movement that will cause all events received in the same frame to be queued and dispatched as individual events. This results in maximum responsiveness but may potentially impact performance depending how many events happen over each frame.
|
inlinestaticconstexpr |
Input channel id of the system cursor position normalized relative to the active window. The position obtained has had os ballistics applied, and is valid regardless of whether the system cursor is hidden or visible. When the system cursor has been constrained to the active window values will be in the [0.0, 1.0] range, but not when unconstrained. See also InputSystemCursorRequests::SetSystemCursorState and GetSystemCursorState.