30 lines
741 B
Go
Raw Normal View History

2020-11-30 17:45:53 +01:00
package handler
import (
"demodesk/neko/internal/types"
"demodesk/neko/internal/types/message"
)
func (h *MessageHandlerCtx) keyboardLayout(session types.Session, payload *message.KeyboardLayout) error {
if !session.IsHost() {
h.logger.Debug().Str("id", session.ID()).Msg("is not the host")
return nil
}
2021-01-12 23:52:44 +01:00
return h.desktop.SetKeyboardLayout(payload.Layout, payload.Variant)
2020-11-30 17:45:53 +01:00
}
func (h *MessageHandlerCtx) keyboardModifiers(session types.Session, payload *message.KeyboardModifiers) error {
if !session.IsHost() {
h.logger.Debug().Str("id", session.ID()).Msg("is not the host")
return nil
}
2021-01-12 22:54:13 +01:00
h.desktop.SetKeyboardModifiers(types.KeyboardModifiers{
NumLock: payload.NumLock,
CapsLock: payload.CapsLock,
})
2020-11-30 17:45:53 +01:00
return nil
}