mirror of
https://github.com/m1k1o/neko.git
synced 2025-04-28 18:06:20 +02:00
25 lines
610 B
Go
25 lines
610 B
Go
package handler
|
|
|
|
import (
|
|
"errors"
|
|
|
|
"github.com/m1k1o/neko/server/pkg/types"
|
|
"github.com/m1k1o/neko/server/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
|
|
}
|