diff --git a/server/internal/remote/manager.go b/server/internal/remote/manager.go index 568ceaf8..4be103f2 100644 --- a/server/internal/remote/manager.go +++ b/server/internal/remote/manager.go @@ -219,8 +219,8 @@ func (manager *RemoteManager) GetScreenSize() *types.ScreenSize { return xorg.GetScreenSize() } -func (manager *RemoteManager) SetKeyboard(layout string) { - xorg.SetKeyboard(layout) +func (manager *RemoteManager) SetKeyboardLayout(layout string) { + xorg.SetKeyboardLayout(layout) } func (manager *RemoteManager) SetKeyboardModifiers(NumLock int, CapsLock int, ScrollLock int) { diff --git a/server/internal/types/remote.go b/server/internal/types/remote.go index a4a9d04f..b437d108 100644 --- a/server/internal/types/remote.go +++ b/server/internal/types/remote.go @@ -22,6 +22,6 @@ type RemoteManager interface { ReadClipboard() string WriteClipboard(data string) ResetKeys() - SetKeyboard(layout string) + SetKeyboardLayout(layout string) SetKeyboardModifiers(NumLock int, CapsLock int, ScrollLock int) } diff --git a/server/internal/websocket/control.go b/server/internal/websocket/control.go index ec7f196f..f477a0ed 100644 --- a/server/internal/websocket/control.go +++ b/server/internal/websocket/control.go @@ -125,7 +125,7 @@ func (h *MessageHandler) controlKeyboard(id string, session types.Session, paylo // change layout if payload.Layout != nil { - h.remote.SetKeyboard(*payload.Layout) + h.remote.SetKeyboardLayout(*payload.Layout) } // set num lock diff --git a/server/internal/xorg/xorg.c b/server/internal/xorg/xorg.c index 9c45c9bc..58421f5f 100644 --- a/server/internal/xorg/xorg.c +++ b/server/internal/xorg/xorg.c @@ -166,7 +166,7 @@ short XGetScreenRate() { return XRRConfigCurrentRate(conf); } -void SetKeyboard(char *layout) { +void SetKeyboardLayout(char *layout) { // TOOD: refactor, use native API. char cmd[13] = "setxkbmap "; strncat(cmd, layout, 2); diff --git a/server/internal/xorg/xorg.go b/server/internal/xorg/xorg.go index ae96629d..39f33f7f 100644 --- a/server/internal/xorg/xorg.go +++ b/server/internal/xorg/xorg.go @@ -211,7 +211,7 @@ func GetScreenSize() *types.ScreenSize { return nil } -func SetKeyboard(layout string) { +func SetKeyboardLayout(layout string) { mu.Lock() defer mu.Unlock() @@ -222,7 +222,7 @@ func SetKeyboard(layout string) { layoutUnsafe := C.CString(layout) defer C.free(unsafe.Pointer(layoutUnsafe)) - C.SetKeyboard(layoutUnsafe) + C.SetKeyboardLayout(layoutUnsafe) } func SetKeyboardModifiers(num_lock int, caps_lock int, scroll_lock int) { diff --git a/server/internal/xorg/xorg.h b/server/internal/xorg/xorg.h index d0a30214..88eca160 100644 --- a/server/internal/xorg/xorg.h +++ b/server/internal/xorg/xorg.h @@ -40,7 +40,7 @@ void XDisplayClose(void); void XDisplaySet(char *input); - void SetKeyboard(char *layout); + void SetKeyboardLayout(char *layout); void SetKeyboardModifiers(int num_lock, int caps_lock, int scroll_lock); #endif