The game controller device interface. More...
#include "murl_i_game_controller.h"
Inherited by Murl::Input::GameControllerDevice.
Public Types | |
using | ButtonArray = Array< IEnums::GameControllerButton > |
Definition of an array holding IEnums::GameControllerButton values. | |
using | ControlArray = Array< IEnums::GameControllerControl > |
Definition of an array holding IEnums::GameControllerControl values. | |
Public Member Functions | |
virtual void | SetConnected (Bool isConnected)=0 |
Set the connected state. More... | |
virtual void | SetPlayerIndex (SInt32 playerIndex)=0 |
Set the player index. More... | |
virtual void | SetDeviceInfo (const IGameControllerMapping::DeviceInfo &deviceInfo)=0 |
Set the device information. More... | |
virtual void | SetAvailableControls (const ButtonArray &buttons, const ControlArray &controls)=0 |
Set the available controls. More... | |
virtual void | PostAxisEvent (IGameControllerMapping::AxisEvent axisEvent, Float value)=0 |
Post the current game controller axis value. More... | |
virtual void | PostButtonEvent (IEnums::GameControllerButton button, Bool pressed)=0 |
Post the current game controller button state. More... | |
virtual void | PostGravityEvent (Float gravX, Float gravY, Float gravZ)=0 |
Post the current game controller gravity values. More... | |
virtual void | PostAccelerationEvent (Float accelX, Float accelY, Float accelZ)=0 |
Post the current game controller acceleration values. More... | |
virtual Bool | TakeTouchOrientationEnabled (Bool &isEnabled)=0 |
Take the touchpad orientation enabled state. More... | |
virtual Bool | TakeTouchAbsoluteEnabled (Bool &isEnabled)=0 |
Take the touchpad absolute enabled state. More... | |
virtual Bool | TakeVibration (Float &intensity, IEnums::GameControllerControl control)=0 |
Take the current vibration. More... | |
virtual IGameControllerMappingPtr | CreateMapping ()=0 |
Create the game controller mapping interface. More... | |
Detailed Description
The game controller device interface.
Used by the platform to post events to the device.
Member Function Documentation
◆ SetConnected()
|
pure virtual |
Set the connected state.
Once a controller is created, it is not allowed to destroy the controller instance when a controller is disconnected. Only the connected state changes. If another controller is connected, the controller instance will be reconfigured.
- Parameters
-
isConnected The connected state.
◆ SetPlayerIndex()
|
pure virtual |
Set the player index.
The player number is typically indicated by lights on the controller, a negative index value indicates an unset state (no lights are lit on the controller).
- Parameters
-
playerIndex The zero-based index of the player.
◆ SetDeviceInfo()
|
pure virtual |
Set the device information.
- Parameters
-
deviceInfo The device information.
◆ SetAvailableControls()
|
pure virtual |
Set the available controls.
Automatically sets the d-pad control to available if any d-pad button is set.
- Parameters
-
buttons An array of avaliable game controller buttons. controls An array of available game controller controls.
◆ PostAxisEvent()
|
pure virtual |
Post the current game controller axis value.
- Parameters
-
axisEvent The axis event, see enum IGameControllerMapping::AxisEvents. value The corresponding event value.
◆ PostButtonEvent()
|
pure virtual |
Post the current game controller button state.
- Parameters
-
button The button identifier. pressed true if the button is pressed.
◆ PostGravityEvent()
|
pure virtual |
Post the current game controller gravity values.
- Parameters
-
gravX The x-axis gravity in meter per seconds^2. gravY The y-axis gravity in meter per seconds^2. gravZ The z-axis gravity in meter per seconds^2.
◆ PostAccelerationEvent()
|
pure virtual |
Post the current game controller acceleration values.
- Parameters
-
accelX The x-axis acceleration in meter per seconds^2. accelY The y-axis acceleration in meter per seconds^2. accelZ The z-axis acceleration in meter per seconds^2.
◆ TakeTouchOrientationEnabled()
Take the touchpad orientation enabled state.
Supported controls are IEnums::GAME_CONTROLLER_CONTROL_TOUCH_ORIENTATION.
- Parameters
-
isEnabled The touchpad orientation enabled state return value.
- Returns
- true if the control is available and the state was modified, if false the 'isEnabled' return value stays unchanged.
◆ TakeTouchAbsoluteEnabled()
Take the touchpad absolute enabled state.
Supported controls are IEnums::GAME_CONTROLLER_CONTROL_TOUCH_ABS_REL.
- Parameters
-
isEnabled The touchpad absolute enabled state return value.
- Returns
- true if the control is available and the state was modified, if false the 'isEnabled' return value stays unchanged.
◆ TakeVibration()
|
pure virtual |
Take the current vibration.
Supported controls are IEnums::GAME_CONTROLLER_CONTROL_VIBRATE_LOW or IEnums::GAME_CONTROLLER_CONTROL_VIBRATE_HIGH.
Automatically sets the used vibration control to available.
- Parameters
-
intensity The intensity of the vibration return value in range [0.0 none .. 1.0 full]. control The game controller control identifier.
- Returns
- true if the control is available and the intensity was modified, if false the 'intensity' return value stays unchanged.
◆ CreateMapping()
|
pure virtual |
Create the game controller mapping interface.
Gamecontroller mapping is supported by USB HID game controller devices only, e.g. XBox controller or iOS controller do not create a mapping.
- Returns
- The game controller mapping interface.
The documentation for this interface was generated from the following file:
- murl_i_game_controller.h