class
Input
Primary module used for dealing with input.
Allows you to receieve and query raw or OS input for mouse/keyboard/gamepad.
Public
Constructors
Input
Methods
~Input
GetAxisValue
Returns value of the specified input axis.
Normally in range [-1.0, 1.0] but can be outside the range for devices with unbound axes (for example mouse).
IsButtonHeld
Query if the provided button is currently being held (this frame or previous frames).
- keyCode
- Code of the button to query.
- deviceIndex
- Device to query the button on (0 - primary).
IsButtonUp
Query if the provided button is currently being released (only true for one frame).
- keyCode
- Code of the button to query.
- deviceIndex
- Device to query the button on (0 - primary).
IsButtonDown
Query if the provided button is currently being pressed (only true for one frame).
- keyCode
- Code of the button to query.
- deviceIndex
- Device to query the button on (0 - primary).
GetPointerPosition
Returns position of the pointer (for example mouse cursor) relative to the screen.
GetPointerDelta
Returns difference between pointer position between current and last frame.
IsPointerButtonHeld
Query if the provided pointer button is currently being held (this frame or previous frames).
- pointerButton
- Code of the button to query.
IsPointerButtonUp
Query if the provided pointer button is currently being released (only true for one frame).
- pointerButton
- Code of the button to query.
IsPointerButtonDown
Query if the provided pointer button is currently being pressed (only true for one frame).
- pointerButton
- Code of the button to query.
IsPointerDoubleClicked
Query has the left pointer button has been double-clicked this frame.
SetMouseSmoothing
Enables or disables mouse smoothing.
Smoothing makes the changes to mouse axes more gradual.
GetDeviceCount
Returns the number of detected devices of the specified type.
GetDeviceName
Returns the name of a specific input device.
Returns empty string if the device doesn't exist.
staticInstance
Returns a reference to the module instance.
Module has to have been started up first otherwise an exception will be thrown.
staticInstancePtr
Returns a pointer to the module instance.
Module has to have been started up first otherwise an exception will be thrown.
staticShutDown
Shuts down this module and frees any resources it is using.
staticIsStarted
Query if the module has been started.
Fields
OnButtonDown
Triggered whenever a button is first pressed.
OnButtonUp
Triggered whenever a button is first released.
OnCharInput
Triggered whenever user inputs a text character.
OnPointerMoved
Triggers when some pointing device (mouse cursor, touch) moves.
OnPointerPressed
Triggers when some pointing device (mouse cursor, touch) button is pressed.
OnPointerReleased
Triggers when some pointing device (mouse cursor, touch) button is released.
OnPointerDoubleClick
Triggers when some pointing device (mouse cursor, touch) button is double clicked.
Internal
Methods
UpdateInternal
Called every frame.
Detects button state changes and prepares callback events to trigger via a call to TriggerCallbacksInternal().
TriggerCallbacksInternal
Triggers any queued input event callbacks.
GetPrivateDataInternal
Returns internal, platform specific privata data.
GetWindowHandle
Returns a handle to the window that is currently receiving input.
NotifyMouseMovedInternal
Called by Mouse when mouse movement is detected.
NotifyAxisMovedInternal
Called by any of the raw input devices when analog axis movement is detected.
NotifyButtonPressedInternal
Called by any of the raw input devices when a button is pressed.
NotifyButtonReleasedInternal
Called by any of the raw input devices when a button is released.
Protected
Methods
~Module<T>
OnStartUp
Override if you want your module to be notified once it has been constructed and started.
OnShutDown
Override if you want your module to be notified just before it is deleted.
staticInstanceInternal
Returns a singleton instance of this module.
Private
Methods
InitRawInput
Performs platform specific raw input system initialization.
CleanUpRawInput
Performs platform specific raw input system cleanup.
SmoothMouse
Smooths the input mouse axis value.
Smoothing makes the changes to the axis more gradual depending on previous values.
- value
- Value to smooth.
- axisIndex
- Index of the mouse axis to smooth, 0 - horizontal, 1 - vertical.
Returns: Smoothed value.
ButtonDown
Triggered by input handler when a button is pressed.
ButtonUp
Triggered by input handler when a button is released.
AxisMoved
Triggered by input handler when a mouse/joystick axis is moved.
CharInput
Called from the message loop to notify user has entered a character.
CursorMoved
Called from the message loop to notify user has moved the cursor.
CursorPressed
Called from the message loop to notify user has pressed a mouse button.
CursorReleased
Called from the message loop to notify user has released a mouse button.
CursorDoubleClick
Called from the message loop to notify user has double-clicked a mouse button.
InputCommandEntered
Called from the message loop to notify user has entered an input command.
MouseWheelScrolled
Called from the message loop to notify user has scrolled the mouse wheel.
InputWindowChanged
Called when window in focus changes, as reported by the OS.
InputFocusLost
Called when the current window loses input focus.
This might be followed by inputWindowChanged() if the focus just switched to another of this application's windows.