mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
Merge branch 'guacamole-kbd' of github.com:m1k1o/neko into kbd-modifier-state-sync
This commit is contained in:
commit
38e1b8f3e5
@ -219,8 +219,8 @@ func (manager *RemoteManager) GetScreenSize() *types.ScreenSize {
|
|||||||
return xorg.GetScreenSize()
|
return xorg.GetScreenSize()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (manager *RemoteManager) SetKeyboard(layout string) {
|
func (manager *RemoteManager) SetKeyboardLayout(layout string) {
|
||||||
xorg.SetKeyboard(layout)
|
xorg.SetKeyboardLayout(layout)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (manager *RemoteManager) SetKeyboardModifiers(NumLock int, CapsLock int, ScrollLock int) {
|
func (manager *RemoteManager) SetKeyboardModifiers(NumLock int, CapsLock int, ScrollLock int) {
|
||||||
|
@ -22,6 +22,6 @@ type RemoteManager interface {
|
|||||||
ReadClipboard() string
|
ReadClipboard() string
|
||||||
WriteClipboard(data string)
|
WriteClipboard(data string)
|
||||||
ResetKeys()
|
ResetKeys()
|
||||||
SetKeyboard(layout string)
|
SetKeyboardLayout(layout string)
|
||||||
SetKeyboardModifiers(NumLock int, CapsLock int, ScrollLock int)
|
SetKeyboardModifiers(NumLock int, CapsLock int, ScrollLock int)
|
||||||
}
|
}
|
||||||
|
@ -125,7 +125,7 @@ func (h *MessageHandler) controlKeyboard(id string, session types.Session, paylo
|
|||||||
|
|
||||||
// change layout
|
// change layout
|
||||||
if payload.Layout != nil {
|
if payload.Layout != nil {
|
||||||
h.remote.SetKeyboard(*payload.Layout)
|
h.remote.SetKeyboardLayout(*payload.Layout)
|
||||||
}
|
}
|
||||||
|
|
||||||
// set num lock
|
// set num lock
|
||||||
|
@ -166,7 +166,7 @@ short XGetScreenRate() {
|
|||||||
return XRRConfigCurrentRate(conf);
|
return XRRConfigCurrentRate(conf);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetKeyboard(char *layout) {
|
void SetKeyboardLayout(char *layout) {
|
||||||
// TOOD: refactor, use native API.
|
// TOOD: refactor, use native API.
|
||||||
char cmd[13] = "setxkbmap ";
|
char cmd[13] = "setxkbmap ";
|
||||||
strncat(cmd, layout, 2);
|
strncat(cmd, layout, 2);
|
||||||
|
@ -211,7 +211,7 @@ func GetScreenSize() *types.ScreenSize {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetKeyboard(layout string) {
|
func SetKeyboardLayout(layout string) {
|
||||||
mu.Lock()
|
mu.Lock()
|
||||||
defer mu.Unlock()
|
defer mu.Unlock()
|
||||||
|
|
||||||
@ -222,7 +222,7 @@ func SetKeyboard(layout string) {
|
|||||||
layoutUnsafe := C.CString(layout)
|
layoutUnsafe := C.CString(layout)
|
||||||
defer C.free(unsafe.Pointer(layoutUnsafe))
|
defer C.free(unsafe.Pointer(layoutUnsafe))
|
||||||
|
|
||||||
C.SetKeyboard(layoutUnsafe)
|
C.SetKeyboardLayout(layoutUnsafe)
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetKeyboardModifiers(num_lock int, caps_lock int, scroll_lock int) {
|
func SetKeyboardModifiers(num_lock int, caps_lock int, scroll_lock int) {
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
void XDisplayClose(void);
|
void XDisplayClose(void);
|
||||||
void XDisplaySet(char *input);
|
void XDisplaySet(char *input);
|
||||||
|
|
||||||
void SetKeyboard(char *layout);
|
void SetKeyboardLayout(char *layout);
|
||||||
void SetKeyboardModifiers(int num_lock, int caps_lock, int scroll_lock);
|
void SetKeyboardModifiers(int num_lock, int caps_lock, int scroll_lock);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user