📄 imwheel.patch
字号:
+ {+ gpm_debug_log(LOG_DEBUG,"calling processMouse", event.type, event.buttons);+ if (processMouse(which_mouse->fd, &event, m_type, kd_mode))+ {+ memcpy(&eventbuf,&event,sizeof(Gpm_Event)); /* * pass it to the client, if any * or to the default handler, if any * or to the selection handler */ /* FIXME -- check event.vc */- (cinfo[event.vc] && do_client(cinfo[event.vc], &event))+ (void)((cinfo[event.vc] && do_client(cinfo[event.vc], &event)) || (cinfo[0] && do_client(cinfo[0], &event))- || do_selection(&event);+ || do_selection(&event));+ memcpy(&event,&eventbuf,sizeof(Gpm_Event));+ }+ gpm_debug_log(LOG_DEBUG,"event.type=0x%x event.buttons=%d", event.type, event.buttons);+ if(!wheel_done && opt_wheel &&+ (event.type&(GPM_DOWN|GPM_DRAG)) &&+ (event.buttons&(GPM_W_UP|GPM_W_DOWN|GPM_W_LEFT|GPM_W_RIGHT)) &&+ event.buttons<=GPM_W_RIGHT)+ {+ gpm_debug_log(LOG_DEBUG,"Button Up!");+ gpm_debug_log(LOG_DEBUG,"event.buttons=%d",event.buttons);+ gpm_debug_log(LOG_DEBUG,"event.type=%s%s",+ (event.type&GPM_DRAG?"GPM_DRAG ":""),+ (event.type&GPM_DOWN?"GPM_DOWN":""));+ wheel_done=1;+ eventFlag=1;+ }+ } while(eventFlag); } } @@ -1148,3 +1286,5 @@ +/* vim:sw=2:ts=8+"*/Only in ../imwheel/gpm-imwheel: gpm.c.origdiff -ru --exclude=Makefile ./gpm.h ../imwheel/gpm-imwheel/gpm.h--- ./gpm.h Fri Nov 12 08:27:37 1999+++ ../imwheel/gpm-imwheel/gpm.h Sun Feb 27 16:30:46 2000@@ -4,6 +4,9 @@ * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) * Copyright (C) 1998 Ian Zimmerman <itz@rahul.net> *+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice+ * <jcatki@home.com>+ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or@@ -69,12 +72,18 @@ #define GPM_NODE_CTL GPM_NODE_DEV #define GPM_NODE_FIFO _PATH_DEV "gpmdata"+#define GPM_WHEEL_FIFO _PATH_DEV "gpmwheel" /*....................................... Cfg buttons */ #define GPM_B_LEFT 4 #define GPM_B_MIDDLE 2 #define GPM_B_RIGHT 1+#define GPM_W_UP 8+#define GPM_W_DOWN 16+#define GPM_W_RIGHT 32+#define GPM_W_LEFT 64+#define GPM_STICK 128 /*....................................... The event types */ @@ -115,6 +124,7 @@ unsigned char buttons, modifiers; /* try to be a multiple of 4 */ unsigned short vc; short dx, dy, x, y;+ short stick_x, stick_y; enum Gpm_Etype type; int clicks; enum Gpm_Margin margin;Only in ../imwheel/gpm-imwheel: gpm.h.origdiff -ru --exclude=Makefile ./gpmCfg.h ../imwheel/gpm-imwheel/gpmCfg.h--- ./gpmCfg.h Fri Nov 12 08:27:37 1999+++ ../imwheel/gpm-imwheel/gpmCfg.h Sun Feb 27 16:32:43 2000@@ -4,6 +4,9 @@ * Copyright 1994-1996 rubini@linux.it * Copyright (C) 1998 Ian Zimmerman <itz@rahul.net> *+ * Modified 9/8/1998 by Jonathan Atkins for wheel support+ * <jcatki@home.com>+ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or@@ -24,7 +27,7 @@ /* $Id: gpmCfg.h,v 1.1.1.1 1999/09/14 15:29:41 paci Exp $ */ -#define GPM_NAME "gpm-Linux"+#define GPM_NAME "gpm-Linux (imwheel)" #define GPM_DATE "$Date: 1999/09/14 15:29:41 $" /* timeout for the select() syscall */@@ -63,5 +66,7 @@ #define DEF_PTRDRAG 1 /* double or triple click */ #define DEF_TOGGLE 0 #define DEF_GLIDEPOINT_TAP 0 /* tapping emulates no buttons by default */+#define DEF_WHEEL 0 /* wheel events active? */+#define DEF_NO_MIDDLE 0 /* deactivate middle button for most mice? */ #endif /* _GPMCFG_INCLUDED */Only in ../imwheel/gpm-imwheel: gpmCfg.h.origdiff -ru --exclude=Makefile ./gpmInt.h ../imwheel/gpm-imwheel/gpmInt.h--- ./gpmInt.h Fri Nov 12 08:27:37 1999+++ ../imwheel/gpm-imwheel/gpmInt.h Sun Feb 27 16:30:46 2000@@ -4,6 +4,9 @@ * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) * Copyright (C) 1998 Ian Zimmerman <itz@rahul.net> *+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice+ * <jcatki@home.com>+ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or@@ -67,6 +70,8 @@ int (*repeat_fun)(Gpm_Event *state, int fd); /* repeat this event into fd */ /* itz Mon Jan 11 23:27:54 PST 1999 */++ int wheel; /* flag for wheel mice */ } Gpm_Type; #define GPM_EXTRA_MAGIC_1 0xAA@@ -88,6 +93,8 @@ int opt_baud,opt_sample,opt_delta, opt_accel, opt_scale, opt_scaley; int opt_time, opt_cluster, opt_three, opt_toggle, opt_glidepoint_tap; Gpm_Type *m_type;+/* not always initialized */+ int opt_wheel,opt_nomiddle; int fd; }; @@ -107,6 +114,8 @@ #define opt_time (which_mouse->opt_time) #define opt_cluster (which_mouse->opt_cluster) #define opt_three (which_mouse->opt_three)+#define opt_wheel (which_mouse->opt_wheel)+#define opt_nomiddle (which_mouse->opt_nomiddle) #define opt_toggle (which_mouse->opt_toggle) #define opt_glidepoint_tap \ (which_mouse->opt_glidepoint_tap)@@ -121,6 +130,7 @@ extern int opt_test, opt_ptrdrag; extern int opt_kill; extern int opt_repeater, opt_double;+extern int opt_wheel_repeater; extern char* opt_repeater_type; extern int opt_kernel, opt_explicittype; extern int opt_aged;@@ -128,6 +138,7 @@ extern char *opt_special; extern int opt_rawrep; extern int fifofd;+extern int wheel_fifofd; extern char *consolename; /* the selected one */ extern Gpm_Type *repeated_type;Only in ../imwheel/gpm-imwheel: gpmInt.h.origdiff -ru --exclude=Makefile ./gpn.c ../imwheel/gpm-imwheel/gpn.c--- ./gpn.c Fri Nov 12 08:27:36 1999+++ ../imwheel/gpm-imwheel/gpn.c Sun Feb 27 16:30:46 2000@@ -8,6 +8,9 @@ * Tue, 5 Jan 1999 23:26:10 +0000, modified by James Troup <james@nocrew.org> * (usage): typo (s/an unexistent/a non-existent/) *+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice+ * <jcatki@home.com>+ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or@@ -183,6 +186,8 @@ printf("Usage: %s [options]\n",prgname); printf(" Valid options are (not all of them are implemented)\n"+ " -2 force two button mouse\n"+ " -3 force three button mouse\n" " -a accel sets the acceleration (default %d)\n" " -A [limit] start with selection disabled (`aged')\n" " -b baud-rate sets the baud rate (default %d)\n"@@ -197,6 +202,7 @@ " -m mouse-device sets mouse device\n" " -M enable multiple mouse. Following options refer to\n" " the second device. Forces \"-R\"\n"+ " -n disable middle button events (on most mice)\n" " -o modem-lines toggle modem lines (\"dtr\", \"rts\", \"both\")\n" " -p draw the pointer while striking a selection\n" " -q quit after changing mouse behaviour\n"@@ -210,7 +216,9 @@ " Use a non-existent type (e.g. \"help\") to get a list\n" " -T test: read mouse, no clients\n" " -v print version and exit\n"- " -V verbosity increase number of logged messages\n", + " -V verbosity increase number of logged messages\n"+ " -w force activate wheel\n"+ " -W activate wheel repeater\n", DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE, DEF_DELTA, DEF_TIME, DEF_LUT, DEF_SCALE, DEF_SAMPLE, DEF_TYPE); return 1;@@ -294,7 +302,7 @@ int cmdline(int argc, char **argv) {- char options[]="a:A::b:B:d:Dg:hi:kl:m:Mo:pqr:R::s:S:t:TvV::23";+ char options[]="a:A::b:B:d:Dg:hi:kl:m:Mno:pqr:R::s:S:t:TvV::wW23"; int i, opt; static struct {char *in; char *out;} seq[] = { {"123","01234567"},@@ -342,6 +350,7 @@ if (0 == opt_repeater_type) opt_repeater_type = "msc"; which_mouse=mouse_table+2; break;+ case 'n': opt_nomiddle=!opt_nomiddle; break; case 'o': if (!strcmp(optarg,"dtr")) opt_toggle=TIOCM_DTR; else if (!strcmp(optarg,"rts")) opt_toggle=TIOCM_RTS;@@ -375,6 +384,8 @@ case 'V': gpm_debug_level += (0 == optarg ? 1 : strtol(optarg, 0, 0)); break;+ case 'w': opt_wheel=1; break;+ case 'W': opt_wheel_repeater=1; break; case '2': opt_three=-1; break; case '3': opt_three=1; break; default:@@ -397,6 +408,13 @@ { oops(GPM_NODE_FIFO); } } + if (opt_wheel_repeater)+ {+ if (mkfifo(GPM_WHEEL_FIFO,0666) && errno!=EEXIST)+ oops(GPM_WHEEL_FIFO);+ if ((wheel_fifofd=open(GPM_WHEEL_FIFO, O_RDWR|O_NONBLOCK))<0)+ oops(GPM_WHEEL_FIFO);+ } /* duplicate initialization */ @@ -498,6 +516,8 @@ } +/* vim:ts=8:sw=2+"*/ /* Local Variables: */ /* c-indent-level: 2 */Only in ../imwheel/gpm-imwheel: gpn.c.origdiff -ru --exclude=Makefile ./liblow.c ../imwheel/gpm-imwheel/liblow.c--- ./liblow.c Fri Nov 12 08:27:37 1999+++ ../imwheel/gpm-imwheel/liblow.c Sun Feb 27 16:30:46 2000@@ -5,6 +5,9 @@ * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) * Copyright (C) 1998 Ian Zimmerman <itz@rahul.net> * + * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice+ * <jcatki@home.com>+ * * xterm management is mostly by jtklehto@stekt.oulu.fi (Janne Kukonlehto) * * This program is free software; you can redistribute it and/or modify@@ -618,7 +621,11 @@ case 0: ePtr->buttons=GPM_B_LEFT; break; case 1: ePtr->buttons=GPM_B_MIDDLE; break; case 2: ePtr->buttons=GPM_B_RIGHT; break;- default: /* Nothing */ break;+ case 3: ePtr->buttons=GPM_W_UP; break;+ case 4: ePtr->buttons=GPM_W_DOWN; break;+ case 5: ePtr->buttons=GPM_W_LEFT; break;+ case 6: ePtr->buttons=GPM_W_RIGHT; break;+ default: /* Nothing */ break; } } /* Coordinates are 33-based */Only in ../imwheel/gpm-imwheel: liblow.c.origdiff -ru --exclude=Makefile ./mev.c ../imwheel/gpm-imwheel/mev.c--- ./mev.c Fri Nov 12 08:27:37 1999+++ ../imwheel/gpm-imwheel/mev.c Sun Feb 27 16:30:46 2000@@ -4,6 +4,9 @@ * Copyright 1994,1995 rubini@linux.it (Alessandro Rubini) * Copyright (C) 1998 Ian Zimmerman <itz@rahul.net> *+ * Modified on 9/8/1998 by Jonathan Atkins for use with wheel mice+ * <jcatki@home.com>+ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or@@ -93,11 +96,12 @@ { if (opt_fit) Gpm_FitEvent(event); - printf("mouse: event 0x%02X, at %2i,%2i (delta %2i,%2i), "
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -