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