0 votes
by (120 points)

Hi,

Is it possible to change clipboard paste from right mouse button to middle mouse button/wheel?

Thanks,
-S

1 Answer

0 votes
by (72.7k points)

Unfortunately, there is no option to modify this. But you can do it manually like this:

// disable default mouse paste
terminal.MousePasteEnabled = false;

// define mouse paste for middle button
terminal.MouseClick += (s, e) =>
{
    if (e.Button == MouseButtons.Middle)
    {
        // get text from clipboard
        string text = null;
        if (Clipboard.ContainsText(TextDataFormat.Text) ||
            Clipboard.ContainsText(TextDataFormat.UnicodeText))
            text = Clipboard.GetText();

        if (text != null)
        {
            try
            {
                // send text to server
                terminal.Scripting.Send(text);
            }
            catch
            {
                // handle pasting errors if necessary
            }
        }
    }
};
...