mirror of
https://github.com/m1k1o/neko.git
synced 2025-05-25 06:57:01 +02:00
clipboard set for control paste.
This commit is contained in:
parent
49ff490640
commit
d5425ea457
3 changed files with 22 additions and 2 deletions
|
@ -99,11 +99,18 @@ func (h *MessageHandlerCtx) controlCopy(session types.Session) error {
|
|||
return h.desktop.KeyPress(xorg.XK_Control_L, xorg.XK_c)
|
||||
}
|
||||
|
||||
func (h *MessageHandlerCtx) controlPaste(session types.Session) error {
|
||||
func (h *MessageHandlerCtx) controlPaste(session types.Session, payload *message.ClipboardData) error {
|
||||
if err := h.controlRequest(session); err != nil && !errors.Is(err, ErrIsAlreadyTheHost) {
|
||||
return err
|
||||
}
|
||||
|
||||
// if there have been set clipboard data, set them first
|
||||
if payload != nil && payload.Text != "" {
|
||||
if err := h.clipboardSet(session, payload); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return h.desktop.KeyPress(xorg.XK_Control_L, xorg.XK_v)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue