add new WS keyboard event

This commit is contained in:
Miroslav Šedivý 2020-06-16 00:55:14 +02:00
parent 56bd6acf10
commit 6206fbbadd
7 changed files with 39 additions and 0 deletions

View file

@ -119,3 +119,14 @@ func (h *MessageHandler) controlClipboard(id string, session types.Session, payl
h.remote.WriteClipboard(payload.Text)
return nil
}
func (h *MessageHandler) controlKeyboard(id string, session types.Session, payload *message.Keyboard) error {
// check if session is host
if !h.sessions.IsHost(id) {
h.logger.Debug().Str("id", id).Msg("is not the host")
return nil
}
h.remote.SetKeyboard(payload.Layout)
return nil
}