mirror of
https://github.com/m1k1o/neko.git
synced 2025-06-10 23:03:05 +02:00
move server to server directory.
This commit is contained in:
parent
da45f62ca8
commit
cfb423b13d
211 changed files with 18 additions and 10 deletions
25
server/internal/websocket/handler/keyboard.go
Normal file
25
server/internal/websocket/handler/keyboard.go
Normal file
|
@ -0,0 +1,25 @@
|
|||
package handler
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/demodesk/neko/pkg/types"
|
||||
"github.com/demodesk/neko/pkg/types/message"
|
||||
)
|
||||
|
||||
func (h *MessageHandlerCtx) keyboardMap(session types.Session, payload *message.KeyboardMap) error {
|
||||
if !session.IsHost() {
|
||||
return errors.New("is not the host")
|
||||
}
|
||||
|
||||
return h.desktop.SetKeyboardMap(payload.KeyboardMap)
|
||||
}
|
||||
|
||||
func (h *MessageHandlerCtx) keyboardModifiers(session types.Session, payload *message.KeyboardModifiers) error {
|
||||
if !session.IsHost() {
|
||||
return errors.New("is not the host")
|
||||
}
|
||||
|
||||
h.desktop.SetKeyboardModifiers(payload.KeyboardModifiers)
|
||||
return nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue