mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
keyboardModifiersGet.
This commit is contained in:
parent
8a9dceafec
commit
4844225a0b
@ -42,9 +42,11 @@ func (h *RoomHandler) Route(r chi.Router) {
|
|||||||
r.Post("/", h.clipboardWrite)
|
r.Post("/", h.clipboardWrite)
|
||||||
})
|
})
|
||||||
|
|
||||||
r.With(auth.HostsOnly).Route("/keyboard", func(r chi.Router) {
|
r.Route("/keyboard", func(r chi.Router) {
|
||||||
r.Post("/layout", h.keyboardLayoutSet)
|
r.With(auth.HostsOnly).Post("/layout", h.keyboardLayoutSet)
|
||||||
r.Post("/modifiers", h.keyboardModifiersSet)
|
|
||||||
|
r.Get("/modifiers", h.keyboardModifiersGet)
|
||||||
|
r.With(auth.HostsOnly).Post("/modifiers", h.keyboardModifiersSet)
|
||||||
})
|
})
|
||||||
|
|
||||||
r.Route("/control", func(r chi.Router) {
|
r.Route("/control", func(r chi.Router) {
|
||||||
|
@ -39,3 +39,12 @@ func (h *RoomHandler) keyboardModifiersSet(w http.ResponseWriter, r *http.Reques
|
|||||||
})
|
})
|
||||||
utils.HttpSuccess(w)
|
utils.HttpSuccess(w)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (h *RoomHandler) keyboardModifiersGet(w http.ResponseWriter, r *http.Request) {
|
||||||
|
data := h.desktop.GetKeyboardModifiers()
|
||||||
|
|
||||||
|
utils.HttpSuccess(w, KeyboardModifiersData{
|
||||||
|
NumLock: data.NumLock,
|
||||||
|
CapsLock: data.CapsLock,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user