Add Xorg modifiers (#57)

* implement additional modifiers to xorg.

* xorg modifiers to API.

* update modifiers api & add ws.

* scroll pos rename to delta and add ctrl key.
This commit is contained in:
Miroslav Šedivý
2023-09-11 16:34:57 +02:00
committed by GitHub
parent a392163819
commit 4da7869e70
13 changed files with 166 additions and 89 deletions

View File

@ -25,13 +25,19 @@ func (s ScreenSize) String() string {
}
type KeyboardModifiers struct {
NumLock *bool
CapsLock *bool
Shift *bool `json:"shift"`
CapsLock *bool `json:"capslock"`
Control *bool `json:"control"`
Alt *bool `json:"alt"`
NumLock *bool `json:"numlock"`
Meta *bool `json:"meta"`
Super *bool `json:"super"`
AltGr *bool `json:"altgr"`
}
type KeyboardMap struct {
Layout string
Variant string
Layout string `json:"layout"`
Variant string `json:"variant"`
}
type ClipboardText struct {
@ -48,7 +54,7 @@ type DesktopManager interface {
// xorg
Move(x, y int)
GetCursorPosition() (int, int)
Scroll(x, y int)
Scroll(deltaX, deltaY int, controlKey bool)
ButtonDown(code uint32) error
KeyDown(code uint32) error
ButtonUp(code uint32) error

View File

@ -115,6 +115,16 @@ type ControlHost struct {
HostID string `json:"host_id,omitempty"`
}
type ControlScroll struct {
// TOOD: remove this once the client is fixed
X int `json:"x"`
Y int `json:"y"`
DeltaX int `json:"delta_x"`
DeltaY int `json:"delta_y"`
ControlKey bool `json:"control_key"`
}
type ControlPos struct {
X int `json:"x"`
Y int `json:"y"`
@ -159,13 +169,11 @@ type ClipboardData struct {
/////////////////////////////
type KeyboardMap struct {
Layout string `json:"layout"`
Variant string `json:"variant"`
types.KeyboardMap
}
type KeyboardModifiers struct {
CapsLock *bool `json:"capslock"`
NumLock *bool `json:"numlock"`
types.KeyboardModifiers
}
/////////////////////////////