mirror of
https://github.com/m1k1o/neko.git
synced 2025-05-28 16:37:15 +02:00
websocket move cursor & scroll.
This commit is contained in:
parent
babddacbf3
commit
81531d74c1
4 changed files with 33 additions and 12 deletions
|
@ -59,6 +59,24 @@ func (h *MessageHandlerCtx) controlRequest(session types.Session) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (h *MessageHandlerCtx) controlMove(session types.Session, payload *message.ControlPos) error {
|
||||
if err := h.controlRequest(session); err != nil && !errors.Is(err, ErrIsAlreadyTheHost) {
|
||||
return err
|
||||
}
|
||||
|
||||
h.desktop.Move(payload.X, payload.Y)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (h *MessageHandlerCtx) controlScroll(session types.Session, payload *message.ControlPos) error {
|
||||
if err := h.controlRequest(session); err != nil && !errors.Is(err, ErrIsAlreadyTheHost) {
|
||||
return err
|
||||
}
|
||||
|
||||
h.desktop.Scroll(payload.X, payload.Y)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (h *MessageHandlerCtx) controlKeyPress(session types.Session, payload *message.ControlKey) error {
|
||||
if err := h.controlRequest(session); err != nil && !errors.Is(err, ErrIsAlreadyTheHost) {
|
||||
return err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue