Author: witekfl                      Date: Tue Dec 16 18:59:40 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- added support for the wheelmouse (works with ELinks)

---- Files affected:
SOURCES:
   fbterm-wheelmouse.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/fbterm-wheelmouse.patch
diff -u /dev/null SOURCES/fbterm-wheelmouse.patch:1.1
--- /dev/null   Tue Dec 16 19:59:41 2008
+++ SOURCES/fbterm-wheelmouse.patch     Tue Dec 16 19:59:35 2008
@@ -0,0 +1,56 @@
+diff -Nru fbterm-1.2/src/lib/shell.cpp fbterm-1.2.new/src/lib/shell.cpp
+--- fbterm-1.2/src/lib/shell.cpp       2008-10-12 11:50:02.000000000 +0200
++++ fbterm-1.2.new/src/lib/shell.cpp   2008-12-16 19:50:29.000000000 +0100
+@@ -142,6 +142,10 @@
+       case Release:
+               if (rtype == MouseX11) val = 3;
+               break;
++      case Wheel:
++              val = 64;
++              if (btn & WheelDown) val |= 1;
++              break;
+       default:
+               break;
+       }
+diff -Nru fbterm-1.2/src/lib/shell.h fbterm-1.2.new/src/lib/shell.h
+--- fbterm-1.2/src/lib/shell.h 2008-10-12 11:50:02.000000000 +0200
++++ fbterm-1.2.new/src/lib/shell.h     2008-12-16 19:21:55.000000000 +0100
+@@ -23,11 +23,13 @@
+ #include "io.h"
+ #include "vterm.h"
+ 
+-enum MouseType { Press = 0, Release, DblClick, Move };
++enum MouseType { Press = 0, Release, DblClick, Move, Wheel };
+ 
+ enum ButtonState {
+       NoButton        = 0x0000,
+       LeftButton      = 0x0001,
++      WheelDown       = 0x0001,
++      WheelUp         = 0x0002,
+       RightButton     = 0x0002,
+       MidButton       = 0x0004,
+       MouseButtonMask = 0x0007,
+diff -Nru fbterm-1.2/src/mouse.cpp fbterm-1.2.new/src/mouse.cpp
+--- fbterm-1.2/src/mouse.cpp   2008-10-12 11:50:02.000000000 +0200
++++ fbterm-1.2.new/src/mouse.cpp       2008-12-16 19:43:09.000000000 +0100
+@@ -101,7 +101,8 @@
+       Gpm_Event *ev = (Gpm_Event*)buf;
+       s32 type = -1, buttons = 0;
+ 
+-      if ((ev->type & GPM_MOVE) || (ev->type & GPM_DRAG)) type = Move;
++      if (ev->wdy) type = Wheel;
++      else if ((ev->type & GPM_MOVE) || (ev->type & GPM_DRAG)) type = Move;
+       else if (ev->type & GPM_DOWN) type = (ev->type & GPM_DOUBLE) ? DblClick 
: Press;
+       else if (ev->type & GPM_UP) type = Release;
+       if (type == -1) return;
+@@ -121,6 +122,10 @@
+       if (newy < 0) newy = 0;
+       if (newx >= maxx) newx = maxx - 1;
+       if (newy >= maxy) newy = maxy - 1;
++      if (type == Wheel) {
++              if (ev->wdy < 0) buttons |= WheelDown;
++              else buttons |= WheelUp;
++      }
+ 
+       if (newx == x && newy == y && !(buttons & MouseButtonMask)) return;
+       
================================================================
_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to