Archived
2
0

remote manager split.

This commit is contained in:
Miroslav Šedivý 2022-09-12 21:39:57 +02:00
parent e3e3cf9d22
commit 0bca8c9d02
3 changed files with 62 additions and 54 deletions

View File

@ -0,0 +1,11 @@
package remote
import "m1k1o/neko/internal/remote/clipboard"
func (manager *RemoteManager) ReadClipboard() string {
return clipboard.Read()
}
func (manager *RemoteManager) WriteClipboard(data string) {
clipboard.Write(data)
}

View File

@ -2,11 +2,9 @@ package remote
import ( import (
"fmt" "fmt"
"os/exec"
"time" "time"
"m1k1o/neko/internal/gst" "m1k1o/neko/internal/gst"
"m1k1o/neko/internal/remote/clipboard"
"m1k1o/neko/internal/remote/xorg" "m1k1o/neko/internal/remote/xorg"
"m1k1o/neko/internal/types" "m1k1o/neko/internal/types"
"m1k1o/neko/internal/types/config" "m1k1o/neko/internal/types/config"
@ -208,55 +206,3 @@ func (manager *RemoteManager) ChangeResolution(width int, height int, rate int)
return nil return nil
} }
func (manager *RemoteManager) Move(x, y int) {
xorg.Move(x, y)
}
func (manager *RemoteManager) Scroll(x, y int) {
xorg.Scroll(x, y)
}
func (manager *RemoteManager) ButtonDown(code int) error {
return xorg.ButtonDown(code)
}
func (manager *RemoteManager) KeyDown(code uint64) error {
return xorg.KeyDown(code)
}
func (manager *RemoteManager) ButtonUp(code int) error {
return xorg.ButtonUp(code)
}
func (manager *RemoteManager) KeyUp(code uint64) error {
return xorg.KeyUp(code)
}
func (manager *RemoteManager) ReadClipboard() string {
return clipboard.Read()
}
func (manager *RemoteManager) WriteClipboard(data string) {
clipboard.Write(data)
}
func (manager *RemoteManager) ResetKeys() {
xorg.ResetKeys()
}
func (manager *RemoteManager) ScreenConfigurations() map[int]types.ScreenConfiguration {
return xorg.ScreenConfigurations
}
func (manager *RemoteManager) GetScreenSize() *types.ScreenSize {
return xorg.GetScreenSize()
}
func (manager *RemoteManager) SetKeyboardLayout(layout string) {
_ = exec.Command("setxkbmap", layout).Run()
}
func (manager *RemoteManager) SetKeyboardModifiers(NumLock int, CapsLock int, ScrollLock int) {
xorg.SetKeyboardModifiers(NumLock, CapsLock, ScrollLock)
}

View File

@ -0,0 +1,51 @@
package remote
import (
"m1k1o/neko/internal/remote/xorg"
"m1k1o/neko/internal/types"
"os/exec"
)
func (manager *RemoteManager) Move(x, y int) {
xorg.Move(x, y)
}
func (manager *RemoteManager) Scroll(x, y int) {
xorg.Scroll(x, y)
}
func (manager *RemoteManager) ButtonDown(code int) error {
return xorg.ButtonDown(code)
}
func (manager *RemoteManager) KeyDown(code uint64) error {
return xorg.KeyDown(code)
}
func (manager *RemoteManager) ButtonUp(code int) error {
return xorg.ButtonUp(code)
}
func (manager *RemoteManager) KeyUp(code uint64) error {
return xorg.KeyUp(code)
}
func (manager *RemoteManager) ResetKeys() {
xorg.ResetKeys()
}
func (manager *RemoteManager) ScreenConfigurations() map[int]types.ScreenConfiguration {
return xorg.ScreenConfigurations
}
func (manager *RemoteManager) GetScreenSize() *types.ScreenSize {
return xorg.GetScreenSize()
}
func (manager *RemoteManager) SetKeyboardLayout(layout string) {
_ = exec.Command("setxkbmap", layout).Run()
}
func (manager *RemoteManager) SetKeyboardModifiers(NumLock int, CapsLock int, ScrollLock int) {
xorg.SetKeyboardModifiers(NumLock, CapsLock, ScrollLock)
}