PATCH: -p0 To: w3m-dev@mi.med.tohoku.ac.jp Cc: kiwamu Subject: [w3m-dev 01739] ホイールマウス対応 patch From: kiwamu Delivered-To: ukai@ukai.org Delivered-To: ukai@debian.or.jp Date: Sun, 18 Feb 2001 02:24:27 +0900 Reply-To: w3m-dev@mi.med.tohoku.ac.jp Message-Id: <20010218022427.A3347@casper.m01.htmnet.ne.jp> X-ML-Name: w3m-dev X-Mail-Count: 01739 X-MLServer: fml [fml 3.0]; post only (only members can post) X-ML-Info: If you have a question, send e-mail with the body "help" (without quotes) to the address w3m-dev-ctl@mi.med.tohoku.ac.jp; help= Resent-From: kiwamu@misterdosv.eei.metro-u.ac.jp Content-Disposition: inline User-Agent: Mutt/1.2.5i-jp0 Resent-Date: Sun, 18 Feb 2001 04:39:48 +0900 Resent-To: w3m-dev@mi.med.tohoku.ac.jp Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Resent-Sender: w3m-dev-admin@mi.med.tohoku.ac.jp こんにちは。岡部究と申します。 あの岡部克也さんとは別人です。(^^;; w3mをホイールマウス対応させてみました。 rxvtとxtermで使用できます。 ktermだとホイールの上下が同じコントロールコードを返してしまうので 実現不可能みたいです。 ------------------------------ w3m-wheel.patch ------------------------------ --- main.c Wed Feb 7 01:53:49 2001 +++ main.c Sun Feb 18 02:05:41 2001 @@ -3461,14 +3461,19 @@ #define MOUSE_BTN1_DOWN 0 #define MOUSE_BTN2_DOWN 1 #define MOUSE_BTN3_DOWN 2 +#define MOUSE_BTN4_DOWN_RXVT 3 +#define MOUSE_BTN5_DOWN_RXVT 4 +#define MOUSE_BTN4_DOWN_XTERM 64 +#define MOUSE_BTN5_DOWN_XTERM 65 #define MOUSE_BTN_UP 3 - +#define MOUSE_BTN_RESET -1 +#define MOUSE_SCROLL_LINE 5 static void process_mouse(int btn, int x, int y) { - int delta_x, delta_y; - static int press_btn, press_x, press_y; + int delta_x, delta_y, i; + static int press_btn = MOUSE_BTN_RESET, press_x, press_y; if (btn == MOUSE_BTN_UP) { switch (press_btn) { @@ -3547,12 +3552,29 @@ mainMenu(x, y); #endif /* MENU */ break; + case MOUSE_BTN4_DOWN_RXVT: + for (i = 0; i < MOUSE_SCROLL_LINE; i++) + ldown1(); + break; + case MOUSE_BTN5_DOWN_RXVT: + for (i = 0; i < MOUSE_SCROLL_LINE; i++) + lup1(); + break; } + } else if (btn == MOUSE_BTN4_DOWN_XTERM) { + for (i = 0; i < MOUSE_SCROLL_LINE; i++) + ldown1(); + } else if (btn == MOUSE_BTN5_DOWN_XTERM) { + for (i = 0; i < MOUSE_SCROLL_LINE; i++) + lup1(); } - else { + + if (btn != MOUSE_BTN4_DOWN_RXVT || press_btn == MOUSE_BTN_RESET) { press_btn = btn; press_x = x; press_y = y; + } else { + press_btn = MOUSE_BTN_RESET; } } --- menu.c Wed Feb 7 01:53:49 2001 +++ menu.c Sun Feb 18 02:05:50 2001 @@ -1067,14 +1067,20 @@ #define MOUSE_BTN1_DOWN 0 #define MOUSE_BTN2_DOWN 1 #define MOUSE_BTN3_DOWN 2 +#define MOUSE_BTN4_DOWN_RXVT 3 +#define MOUSE_BTN5_DOWN_RXVT 4 +#define MOUSE_BTN4_DOWN_XTERM 64 +#define MOUSE_BTN5_DOWN_XTERM 65 #define MOUSE_BTN_UP 3 +#define MOUSE_BTN_RESET -1 +#define MOUSE_SCROLL_LINE 5 static int process_mMouse(int btn, int x, int y) { Menu *menu; int select; - static int press_btn, press_x, press_y; + static int press_btn = MOUSE_BTN_RESET, press_x, press_y; char c = ' '; menu = CurrentMenu; ------------------------------ w3m-wheel.patch ------------------------------ -- Tokyo Metropolitan University Kiwamu Okabe Mail: kiwamu@debian.or.jp URL: http://silica.eei.metro-u.ac.jp/~kiwamu/