Sent: Wed Apr 11 2012 16:06:44 GMT-0400 (EDT)
From: Patrick H. <[email protected]>
To: [email protected]
Subject: Re: disable mouse reporting briefly on window focus
Sent: Wed Apr 11 2012 15:36:34 GMT-0400 (EDT)
From: Zsbán Ambrus <[email protected]>
To: [email protected]
Subject: Re: disable mouse reporting briefly on window focus
On 4/11/12, Martin Pohlack<[email protected]> wrote:
On 11.04.2012 16:42, Patrick Hemmer wrote:
if I'm running vim with mouse
support, and I click the window to focus it, the vim cursor wont move.
I would approach this via one of the two alternatives:
I use a third approach. I disable mouse support in most terminal
applications entirely. I definitely disable it in the editor. For
some applications where this would be difficult (I'd have to recompile
the application, eg. for elinks or aptitude), I disable mouse support
in urxvt itself, for which I use a patch to urxvt that I've posted to
the mailing list at some point (though I'll need to update it from
urxvt 9.14 to urxvt 9.15).
Ambrus
I'm going to have to go with the analogy of that being like cutting
off your arm because it keeps getting in the way. :-)
And not that I dont appreciate the alternate ideas, but I'd like to
solve the original issue. Even if I dont use it, I would still like to
know why its not working, or how to properly deactivate mouse reporting.
Finally figured it out. Vim wasnt using mode '9' for the mouse
reporting, it was using '1002'. So I was resetting the wrong mouse
reporting mode.
But there's a caveat. The mouse reporting has to be disabled before the
'button_press' event. If you disable mouse reporting in 'button_press',
the escape code for cursor position still gets sent. I ended up
disabling reporting in 'focus_in' and creating a timer that turns
reporting back on after 0.001 seconds unless the 'button_press' event
occurred before the timer expired, in which case mouse reporting is
turned back on by a 'button_release' event instead.
Not a super clean solution, but its fairly clean. Much better than
consuming tt_write events.
-Patrick
_______________________________________________
rxvt-unicode mailing list
[email protected]
http://lists.schmorp.de/cgi-bin/mailman/listinfo/rxvt-unicode