TcrSdk-Windows V1.0
Public Types | Public Member Functions | List of all members
Gamepad Class Referenceabstract

This interface is used to interact with the virtual Gamepad device on the server. More...

#include <gamepad.h>

Public Types

enum class  KeyType { LS , RS , LT , RT }
 The type of a general controller button. More...
 

Public Member Functions

virtual void ConnectGamepad () const =0
 Trigger the cloud machine to insert the virtual Gamepad.
 
virtual void DisconnectGamepad () const =0
 Trigger the cloud machine to pull out the virtual Gamepad.
 
virtual void OnGamepadKey (int32_t keycode, bool down) const =0
 Trigger a key event of the cloud Gamepad.
 
virtual void OnGamepadStick (const Gamepad::KeyType &type, int32_t x, int32_t y) const =0
 Trigger a stick event of the cloud Gamepad.
 
virtual void OnGamepadTrigger (const Gamepad::KeyType &type, int32_t value, bool down) const =0
 Trigger a trigger event of the cloud Gamepad.
 

Detailed Description

This interface is used to interact with the virtual Gamepad device on the server.

Member Enumeration Documentation

◆ KeyType

enum class KeyType
strong

The type of a general controller button.

Enumerator
LS 

The left stick.

RS 

The right stick.

LT 

The left trigger.

RT 

The right trigger.

Member Function Documentation

◆ ConnectGamepad()

virtual void ConnectGamepad ( ) const
pure virtual

Trigger the cloud machine to insert the virtual Gamepad.

◆ DisconnectGamepad()

virtual void DisconnectGamepad ( ) const
pure virtual

Trigger the cloud machine to pull out the virtual Gamepad.

◆ OnGamepadKey()

virtual void OnGamepadKey ( int32_t  keycode,
bool  down 
) const
pure virtual

Trigger a key event of the cloud Gamepad.

Parameters
keycodeThe keycode.
downtrue if the button is pressed, false if the button is released.

◆ OnGamepadStick()

virtual void OnGamepadStick ( const Gamepad::KeyType type,
int32_t  x,
int32_t  y 
) const
pure virtual

Trigger a stick event of the cloud Gamepad.

Parameters
typeThe stick type. See {
See also
KeyType::LS}, {
KeyType::RS}.
Parameters
xThe X coordinate of the stick
yThe Y coordinate of the stick

◆ OnGamepadTrigger()

virtual void OnGamepadTrigger ( const Gamepad::KeyType type,
int32_t  value,
bool  down 
) const
pure virtual

Trigger a trigger event of the cloud Gamepad.

Parameters
typeThe trigger type. See {
See also
KeyType::LT}, {
KeyType::RT}.
Parameters
valueThe absolute position of the trigger control. The value is normalized to a range from 0 (released) to 255 (fully pressed).
downtrue if the trigger is pressed, false if the trigger is released.

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