TcrSdk-Windows V1.0
gamepad.h
Go to the documentation of this file.
1#ifndef TCRSDK_GAMEPAD_H_
2#define TCRSDK_GAMEPAD_H_
3
4#include<stdint.h>
5
9 class Gamepad
10 {
11 public:
15 enum class KeyType {
19 LS,
23 RS,
27 LT,
31 RT
32 };
33
37 virtual void ConnectGamepad() const = 0;
38
42 virtual void DisconnectGamepad() const = 0;
43
50 virtual void OnGamepadKey(int32_t keycode, bool down) const = 0;
51
59 virtual void OnGamepadStick(const Gamepad::KeyType& type, int32_t x, int32_t y) const = 0;
60
61
70 virtual void OnGamepadTrigger(const Gamepad::KeyType& type, int32_t value, bool down) const = 0;
71 };
72
73#endif
74
This interface is used to interact with the virtual Gamepad device on the server.
Definition gamepad.h:10
virtual void OnGamepadKey(int32_t keycode, bool down) const =0
Trigger a key 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.
KeyType
The type of a general controller button.
Definition gamepad.h:15
@ RT
The right trigger.
@ RS
The right stick.
@ LT
The left trigger.
@ LS
The left stick.
virtual void DisconnectGamepad() const =0
Trigger the cloud machine to pull out the virtual 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 ConnectGamepad() const =0
Trigger the cloud machine to insert the virtual Gamepad.