Re: Gnome Terminal, VIM & Wheel Mouse



OK, here is the tiny patch in question - could you push this so that it
doesn't waits too much before appearing in CVS and Ximian distribs
please ? I find this really useful - at least, scrolling in VIM with the
wheel !

What it does:

it generates "correct" button escape sequences for mouse wheel, e.g.
buttons 4 and 5. "correct" means the same as newer xterms, and tested
with VIM. It works very well, and doesn't seem to break anything.

Cheers,
	Xav

--- zvt.orig/gnome-libs-1.4.1.2/zvt/vt.c	Sat Nov 25 19:49:08 2000
+++ zvt.new/gnome-libs-1.4.1.2/zvt/vt.c	Mon Oct  1 19:28:57 2001
@@ -2188,6 +2188,7 @@
 {
   char mouse_info[16];
   int mode = vt->mode & VTMODE_SEND_MOUSE_MASK;
+  static char buttonchar[] = " !\"`abc";
 
   if (y>=0) {
     mouse_info[0]=0;
@@ -2195,13 +2196,13 @@
     case VTMODE_SEND_MOUSE_PRESS: /* press only */
       if (down)
 	g_snprintf(mouse_info, sizeof(mouse_info), "\033[M%c%c%c",
-		   ' ' + ((button - 1)&3),
+		   buttonchar[(button - 1)&7],
 		   x+' '+1,
 		   y+' '+1);
       break;
     case VTMODE_SEND_MOUSE_BOTH:
       g_snprintf(mouse_info, sizeof(mouse_info), "\033[M%c%c%c",
-		 (down?(' ' + ((button - 1)&3)):(' '+3)) | /* 0 = lmb, 1 = mid, 2 = rmb, 3 = up */
+		 (down?(buttonchar[(button - 1)&7]):(' '+3)) | /* ' ' = lmb, '!' = mid, '"' = rmb, '#' = up, '`' = wheel-down, 'a' = wheel-up */
 		 ((qual&1)?4:0) | /* shift */
 		 ((qual&8)?8:0) | /* meta */
 		 ((qual&4)?16:0), /* control */



le ven 28-09-2001 at 02:13 NotZed a écrit :
> 
> I have no plans at all with libzvt.
> 
> I don't see why it wouldn't be possible to do with a tiny patch.
> 
> > 
> > Hi !
> > 
> > GNOME Terminal doesn't report correctly the Button4/5 events generated
> > by my wheel mouse, and so VIM can't make use of it (I tried with an
> > xterm, as stated in the docs, and it works out-of-the-box).
> > 
> > Is there any plan to fix this ?
> > 
> >            Xav
> > 
> 
> 






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]