mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
add control cut.
This commit is contained in:
parent
e8c7ab421a
commit
26ab7fa12d
@ -37,6 +37,7 @@ const (
|
||||
CONTROL_KEYDOWN = "control/keydown"
|
||||
CONTROL_KEYUP = "control/keyup"
|
||||
// actions
|
||||
CONTROL_CUT = "control/cut"
|
||||
CONTROL_COPY = "control/copy"
|
||||
CONTROL_PASTE = "control/paste"
|
||||
CONTROL_SELECT_ALL = "control/select_all"
|
||||
|
@ -83,6 +83,14 @@ func (h *MessageHandlerCtx) controlKeyUp(session types.Session, payload *message
|
||||
return h.desktop.KeyUp(payload.Keysym)
|
||||
}
|
||||
|
||||
func (h *MessageHandlerCtx) controlCut(session types.Session) error {
|
||||
if err := h.controlRequest(session); err != nil && !errors.Is(err, ErrIsAlreadyTheHost) {
|
||||
return err
|
||||
}
|
||||
|
||||
return h.desktop.KeyPress(xorg.XK_Control_L, xorg.XK_x)
|
||||
}
|
||||
|
||||
func (h *MessageHandlerCtx) controlCopy(session types.Session) error {
|
||||
if err := h.controlRequest(session); err != nil && !errors.Is(err, ErrIsAlreadyTheHost) {
|
||||
return err
|
||||
|
@ -92,6 +92,8 @@ func (h *MessageHandlerCtx) Message(session types.Session, data types.WebSocketM
|
||||
err = utils.Unmarshal(payload, data.Payload, func() error {
|
||||
return h.controlKeyUp(session, payload)
|
||||
})
|
||||
case event.CONTROL_CUT:
|
||||
err = h.controlCut(session)
|
||||
case event.CONTROL_COPY:
|
||||
err = h.controlCopy(session)
|
||||
case event.CONTROL_PASTE:
|
||||
|
Loading…
Reference in New Issue
Block a user