[Urwid] Pasting in X-11
Ian Ward
ian at excess.org
Wed Aug 16 13:38:21 EDT 2006
Todd Miller wrote:
> I'd like to be able to use the middle mouse button in X-11 to paste long
> filenames or URLs into an Edit widget. This isn't working for me. Is
> X-11 pasting supported in urwid? (Right now, I'm definitely seeing
> mouse button 2 events but I'm not sure how to get access to the paste
> data.)
Once you have enabled mouse events in an Urwid application (or a curses
application) the terminal changes the default mouse behaviour to pass
events to the application instead of copy/paste. Most terminals let you
get the original mouse behaviour by holding shift.
That means that shift+middle button will send the text in the clipboard
to Urwid as if the user had typed it, so the text will appear in the
Edit widget where the cursor is (not where you click).
If you would like to add X11 clipboard handling code to Urwid I'd be
happy to accept patches :-)
Ian
More information about the Urwid
mailing list