add button events to control WebSocket.

This commit is contained in:
Miroslav Šedivý
2022-07-23 00:22:26 +02:00
parent f4a4e0152e
commit 7d5ec0190a
6 changed files with 57 additions and 2 deletions

View File

@ -54,6 +54,7 @@ type DesktopManager interface {
KeyDown(code uint32) error
ButtonUp(code uint32) error
KeyUp(code uint32) error
ButtonPress(code uint32) error
KeyPress(codes ...uint32) error
ResetKeys()
ScreenConfigurations() map[int]ScreenConfiguration

View File

@ -32,8 +32,11 @@ const (
CONTROL_RELEASE = "control/release"
CONTROL_REQUEST = "control/request"
// mouse
CONTROL_MOVE = "control/move"
CONTROL_SCROLL = "control/scroll"
CONTROL_MOVE = "control/move"
CONTROL_SCROLL = "control/scroll"
CONTROL_BUTTONPRESS = "control/buttonpress"
CONTROL_BUTTONDOWN = "control/buttondown"
CONTROL_BUTTONUP = "control/buttonup"
// keyboard
CONTROL_KEYPRESS = "control/keypress"
CONTROL_KEYDOWN = "control/keydown"

View File

@ -106,6 +106,10 @@ type ControlPos struct {
Y int `json:"y"`
}
type ControlButton struct {
Code uint32 `json:"code"`
}
type ControlKey struct {
Keysym uint32 `json:"keysym"`
}