This interface is used to interact with the virtual Mouse device on the server.
More...
#include <mouse.h>
|
virtual void | SetMouseCursorStyle (const CursorStyle &cursor_style) const =0 |
| Set the cursor style.
|
|
virtual void | OnMouseKey (const MouseKeyType &key, bool down) const =0 |
| Trigger a click event of the cloud mouse.
|
|
virtual void | OnMouseScroll (float delta) const =0 |
| Rotate the scroll wheel of the cloud mouse.
|
|
virtual void | OnMouseMoveTo (int32_t x, int32_t y) const =0 |
| After you get the coordinates of the local View, you need to convert the coordinates to the coordinates of the remote end before calling this method.Before calculation, you need to get the width and height of the gameView [localViewWidth, localViewHeight] and the position of the click position in the game screen [localX, localY].
|
|
This interface is used to interact with the virtual Mouse device on the server.
◆ CursorStyle
The style of the cloud cursor.
Enumerator |
---|
NORMAL | The default cursor style.
|
HUGE | The big cursor style.
|
◆ MouseKeyType
General mouse button types.
Enumerator |
---|
LEFT | The left mouse button.
|
RIGHT | The right mouse button.
|
MIDDLE | The middle mouse button (scroll wheel)
|
FORWARD | The forward side button.
|
BACKWARD | The back side button.
|
◆ OnMouseKey()
virtual void OnMouseKey |
( |
const MouseKeyType & |
key, |
|
|
bool |
down |
|
) |
| const |
|
pure virtual |
Trigger a click event of the cloud mouse.
- Parameters
-
key | The mouse button. Valid values: left : The left button; middle : The scroll wheel; right : The right button; forward : The forward side button; backward : The back side button. |
down | Valid values: true : Press; false : Release. |
◆ OnMouseMoveTo()
virtual void OnMouseMoveTo |
( |
int32_t |
x, |
|
|
int32_t |
y |
|
) |
| const |
|
pure virtual |
After you get the coordinates of the local View, you need to convert the coordinates to the coordinates of the remote end before calling this method.Before calculation, you need to get the width and height of the gameView [localViewWidth, localViewHeight] and the position of the click position in the game screen [localX, localY].
Then calculate the coordinates through the following sample code to get [remoteX,remoteY].
Finally, call the interface to send the mouse movement event. You can refer to the sample code below to complete your own calculations.
// localX/localY: click coordinates on gameView
// localViewWidth/localViewHeight: gameView width&height
remoteX = localX * 8192 / localViewWidth;
remoteY = localY * 8192 / localViewHeight;
// send mouse move message
onMoveTo(remoteX,remoteY);
- Parameters
-
x | The X coordinate on the remote device |
y | The Y coordinate on the remote device |
◆ OnMouseScroll()
virtual void OnMouseScroll |
( |
float |
delta | ) |
const |
|
pure virtual |
Rotate the scroll wheel of the cloud mouse.
- Parameters
-
delta | Valid values: -1.0~1.0 |
◆ SetMouseCursorStyle()
virtual void SetMouseCursorStyle |
( |
const CursorStyle & |
cursor_style | ) |
const |
|
pure virtual |
Set the cursor style.
The cursor style {
- See also
- CursorStyle} will be updated immediately: the new cursor style will be distributed from the cloud through the data channel. You can get the latest mouse style image from Observer.
- Parameters
-
cursorStyle | The new cursor style, which will overwrite the original style value. |
The documentation for this class was generated from the following file: