[Urwid] Re: urwid mouse support

Ian Ward ian at excess.org
Fri Mar 31 14:56:54 EST 2006

Larry Riedel wrote:

>I have never actually used urwid before, but I
>saw an announcement on LWN saying there is new
>mouse support, so I thought I would give it a
>quick try.  I downloaded and unpacked 0.9.2 and
>ran input_test.py in an xterm running GNU screen
>inside it.  It showed the button press and release
>correctly; for the scroll wheel it showed a lot of
>button 4 and 5 presses but no releases (I do not
>know if there is supposed to be releases).
In my testing the mouse wheel reports release events on some terminals, 
other terminals don't report them, and other terminals report two click 
events each time (quite annoying, really).

>There is one thing I was hoping to see but did not;
>in a vanilla xterm, it can report the mouse position
>while it is moving.  This did not happen with urwid.
>If you are not sure what I am saying, a good example
>would be if I run vim looking at a page of text;
>I can press button 1 near the upper left corner
>and move the mouse toward the lower right with the
>button 1 still down, and vim will select the next as
>I am moving the mouse, just like a normal GUI.  I am
>not sure if you are familiar with this feature, but
>I think it is /very/ desirable; I do not know if it
>works with anything besides xterm; I have /never/
>seen it work inside GNU screen (unfortunately).
Yes, I could add support for "button event tracking".  I could then 
handle the drag events when I add selection ranges to the edit widgets, 
and the effect should be like what you see in vim. 

I could try enabling it in the next release and hope that most terminals 
support it, or at least fall back to normal tracking mode. Let me look 
into it.


More information about the Urwid mailing list