2020-11-30 17:45:53 +01:00
|
|
|
package handler
|
|
|
|
|
|
|
|
import (
|
2021-09-01 23:10:18 +02:00
|
|
|
"errors"
|
|
|
|
|
2022-07-14 00:58:22 +02:00
|
|
|
"github.com/demodesk/neko/pkg/types"
|
|
|
|
"github.com/demodesk/neko/pkg/types/message"
|
2020-11-30 17:45:53 +01:00
|
|
|
)
|
|
|
|
|
2021-01-15 16:53:03 +01:00
|
|
|
func (h *MessageHandlerCtx) keyboardMap(session types.Session, payload *message.KeyboardMap) error {
|
2020-11-30 17:45:53 +01:00
|
|
|
if !session.IsHost() {
|
2021-09-01 23:10:18 +02:00
|
|
|
return errors.New("is not the host")
|
2020-11-30 17:45:53 +01:00
|
|
|
}
|
|
|
|
|
2023-09-11 16:34:57 +02:00
|
|
|
return h.desktop.SetKeyboardMap(payload.KeyboardMap)
|
2020-11-30 17:45:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
func (h *MessageHandlerCtx) keyboardModifiers(session types.Session, payload *message.KeyboardModifiers) error {
|
|
|
|
if !session.IsHost() {
|
2021-09-01 23:10:18 +02:00
|
|
|
return errors.New("is not the host")
|
2020-11-30 17:45:53 +01:00
|
|
|
}
|
|
|
|
|
2023-09-11 16:34:57 +02:00
|
|
|
h.desktop.SetKeyboardModifiers(payload.KeyboardModifiers)
|
2020-11-30 17:45:53 +01:00
|
|
|
return nil
|
|
|
|
}
|