Sophie

Sophie

distrib > * > 2008.0 > x86_64 > by-pkgid > bf57df0185c22fe21edffdd46b135cec > files > 7

imwheel-1.0.0-0.20070707.1mdv2008.0.src.rpm

--- imwheel-1.0.0pre12.orig/README
+++ imwheel-1.0.0pre12/README
@@ -1,5 +1,3 @@
-                                           www.FreshMeat.net appindex# 903164189
-
                                     Overview
                                     """"""""
 This is a not so short little ditty that does the simple conversion of mouse
@@ -15,14 +13,13 @@
                                     Required
                                     """"""""
 
-    XFree86 >= 3.3.2 (or other XServer with wheel to mouse button support)
-        not version 4.0.0 for gpm or jam use, FIFO support is broken there.
-		it is fixed in 4.0.1 so upgrade if you are on 4.0.0
-    Intellimouse or Logitech MouseMan+ (other wheel mice work too...)
-
-to compile from source:
-    
-    The X11 include files and libraries. (Not the X server development packages)
+XFree86 >= 3.3.2 (or other XServer with wheel to mouse button support)
+not version 4.0.0 for gpm or jam use, FIFO support is broken there.
+It is fixed in 4.0.1 so upgrade if you are on 4.0.0
+Intellimouse or Logitech MouseMan+ (other wheel mice work too...)
+
+To compile from source, you need the X11 include files and libraries.
+(Not the X server development packages)
 
                                   Installation
                                   """"""""""""
@@ -90,9 +87,6 @@
 3) make install
    This will currently install to /usr/local/bin, so edit the Makefile to
    change this behavior.
-   Don't forget to choose whether you want imwheel to be setuid root.  This is
-   required for any users who need to use imwheel and the pidfile stuff to track
-   running imwheels.
 
 4) After XWindows is started run imwheel like this:
 
@@ -151,9 +145,6 @@
    change this behavior.
    if you want ALL the gpm stuff enter that directory and "make install" there.
    The usual install only installs the gpm executable.
-   Don't forget to choose whether you want imwheel to be setuid root.  This is
-   required for any users who need to use imwheel and the pidfile stuff to track
-   running imwheels.
 
 4) After XWindows is started run :
 
@@ -224,7 +215,7 @@
 [ OVERVIEW ]
 
 The configuration of specific clients is taken care of in the file called 
-"$HOME/.imwheelrc" or "/etc/X11/imwheelrc".
+"$HOME/.imwheelrc" or "/etc/X11/imwheel/imwheelrc".
 
 All arguments in the file are separated by commas.
 
@@ -346,7 +337,7 @@
 
 [ DELAYS ]
 
-Two delays are configurable in the "/etc/X11/imwheelrc" and/or the
+Two delays are configurable in the "/etc/X11/imwheel/imwheelrc" and/or the
 "$HOME/.imwheelrc" files.  The first delay is the delay between repetitions.
 The second delay is the delay between key down and key up events.  If you make
 the delay too long expect the likelyness of the sticky keys bug to occur (see
@@ -358,7 +349,7 @@
 
 See the included imwheelrc file for a few examples of configured windows.  This 
 file is a good start and may be copied into the users home directory as 
-".imwheelrc" and/or into /etc/X11/imwheelrc for a default setup for all users.  
+".imwheelrc" and/or into /etc/X11/imwheel/imwheelrc for a default setup for all users.  
 Then modify your individual copy or the /etc copy to add more windows.
 
 [ CONFIGURATION HELPER ]
@@ -426,7 +417,7 @@
 Use the -h or --help option for all available options, and documentation.
 --long-args can also be written as -long-args, but this sometimes causes other
 combinations of short-args to fail due to ambiguity, just state them separately
-to avoid the ambiguity.  (e.g.: -pdD => -p -d -D)
+to avoid the ambiguity.  (e.g.: -dD => -d -D)
 Notation: "<>" surrounds required args
           "[]" surrounds optional args.
 
@@ -454,15 +445,9 @@
                        Must exist before running imwheel in this mode.
 -k
 --kill          Attempts to kill old imwheel (written in --wheel-fifo method
-                only.) Pidfile must be created for this to work.  Process is
-                tested using /proc/${pid}/status Name: field ?= imwheel. 
+                only.) Process is tested using:
+                /proc/${pid}/status Name: field ?= imwheel. 
                 If /proc is not mounted then this fails everytime!
--p
---pid           Don't write a pidfile for --wheel-fifo method.  This is the only
-                method that uses the pidfile.  XGrab doesn't need it, so it just
-                issues a warning about starting multiple imwheels on the same
-                display.
-
 -X <display>
 --display <display>
                 use XServer at a specified display in standard X form.
@@ -532,6 +517,6 @@
                                   """"""" """"
                                 Jonathan Atkins
                               2012 River Run Trail
-                           Fort Wayne, IN 46825-6041
+                            Fort Wayne, IN 46825-6041
 
-							  jcatki@jonatkins.org
+                            <jcatki@jcatki.no-ip.org>
--- imwheel-1.0.0pre12.orig/configure.in
+++ imwheel-1.0.0pre12/configure.in
@@ -321,8 +321,6 @@
 AC_CHECK_LIB(X11, XCreateWindow,, [
 	AC_MSG_ERROR([IMWheel depends on the X11 libraries!])
 ], $LIBS_saved $X_LIBS)
-AC_CHECK_LIB(Xext, XextAddDisplay,,,$LIBS_saved $X_LIBS)
-AC_CHECK_LIB(Xt, XtFree,,,$LIBS_saved $X_LIBS)
 AC_CHECK_LIB(Xmu, XmuInternAtom,,,$LIBS_saved $X_LIBS)
 AC_CHECK_LIB(Xtst, XTestFakeDeviceKeyEvent,, [
 	AC_MSG_ERROR([IMWheel depends on the XTest extention!])
--- imwheel-1.0.0pre12.orig/debian/60imwheel_start-imwheel
+++ imwheel-1.0.0pre12/debian/60imwheel_start-imwheel
@@ -0,0 +1,5 @@
+# Starts the imwheel process.
+. /etc/X11/imwheel/startup.conf
+if [ "$IMWHEEL_START" = "1" ]; then
+	/usr/bin/imwheel "${IMWHEEL_PARAMS}"
+fi
--- imwheel-1.0.0pre12.orig/debian/startup.conf
+++ imwheel-1.0.0pre12/debian/startup.conf
@@ -0,0 +1,12 @@
+# Configuration file for setting imwheel startup parameters.
+
+# Set this to "1" to make imwheel start along with your X session.
+IMWHEEL_START=0
+
+# Specify the command line parameters to pass to imwheel.
+# Simply uncomment the bottom line, and if necessary replace
+# the default options with your own. A button spec of "0 0 8 9"
+# will grab the thumb buttons of most mice. "0 0 0 0 8 9" should
+# work for mice with a scroll wheel with two axes. Keep in mind
+# that each button number must be separated by a space.
+#IMWHEEL_PARAMS='-b "0 0 8 9"'
--- imwheel-1.0.0pre12.orig/Makefile.am
+++ imwheel-1.0.0pre12/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS=jax @getopt@ @mdetect@ @gpm_imwheel@
+SUBDIRS=jax getopt @mdetect@ @gpm_imwheel@
 
 bin_PROGRAMS=imwheel
 
@@ -22,19 +22,6 @@
 		find $(distdir) -name CVS -exec rm -rvf '{}' ';' ; \
 	done
 
-ETCDIR=/etc/X11/imwheel
-
-install-exec-hook:
-if SUID
-	progname=$(DESTDIR)$(bindir)/`echo imwheel|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'` ; \
-	chown @suid@ $$progname ; \
-	chmod u+s $$progname
-endif
-	$(mkinstalldirs) $(ETCDIR)
-	-[ -f /etc/imwheelrc ] && mv /etc/imwheelrc $(ETCDIR)/imwheelrc || true
-	-[ -f /etc/X11/imwheelrc ] && mv /etc/X11/imwheelrc $(ETCDIR)/imwheelrc || true
-	-[ -f $(ETCDIR)/imwheelrc ] && install -m 644 imwheelrc $(ETCDIR)/imwheelrc.new || install -m 644 imwheelrc $(ETCDIR)/imwheelrc
-
 extras: $(EXTRA_PROGRAMS)
 
 if NO_GPM_DOC
--- imwheel-1.0.0pre12.orig/config.h.in
+++ imwheel-1.0.0pre12/config.h.in
@@ -24,15 +24,9 @@
 /* Define to 1 if you have the `X11' library (-lX11). */
 #undef HAVE_LIBX11
 
-/* Define to 1 if you have the `Xext' library (-lXext). */
-#undef HAVE_LIBXEXT
-
 /* Define to 1 if you have the `Xmu' library (-lXmu). */
 #undef HAVE_LIBXMU
 
-/* Define to 1 if you have the `Xt' library (-lXt). */
-#undef HAVE_LIBXT
-
 /* Define to 1 if you have the `Xtst' library (-lXtst). */
 #undef HAVE_LIBXTST
 
--- imwheel/util.c	2004-09-05 20:50:54.000000000 -0700
+++ imwheel/util.c.new	2007-07-07 12:34:57.000000000 -0700
@@ -52,15 +52,9 @@
 
 typedef void (*sighandler_t)(int);
 
-int buttons[NUM_BUTTONS+1]={4,5,6,7,8,9,0};
-const char *button_names[]={
-	"Up",
-	"Down",
-	"Left",
-	"Right",
-	"Thumb1",
-	"Thumb2"
-};
+int *buttons = NULL;
+int buttons_cnt = 0;
+char *(*button_names)[] = NULL;
 int statebits[STATE_MASK+1];
 char *wname=NULL;
 XClassHint xch={NULL,NULL};
@@ -93,7 +87,7 @@ const int reps[1<<NUM_STATES]=
 	20,			//          ControlMask|Mod1Mask
 	50			//ShiftMask|ControlMask|Mod1Mask
 };
-const char *keys[NUM_BUTTONS][1<<NUM_STATES]=
+const char *keys[NUM_STDCOMMANDS][1<<NUM_STATES]=
 {
 	{
 		"Page_Up",		//None
@@ -185,6 +179,43 @@ void setupstatebits()
 
 /*----------------------------------------------------------------------------*/
 
+void setupbuttonnames()
+{
+	char buf[10 + 5 + 1]; // strlen(2^31=2147483648) + strlen("ExtBt") + NULL
+	int i;
+	
+	// allocate enough memory (buttons_cnt should be known by now)
+	Printf("Allocating %d names\n", buttons_cnt);
+	button_names = malloc(buttons_cnt * sizeof(char *) + 1000);
+
+	// we have the 6 legacy buttons, but only as many as the user has declared
+	switch ((buttons_cnt<=6)?buttons_cnt:6)
+	{
+		case 6:
+			(*button_names)[5] = "Thumb2";
+		case 5:
+			(*button_names)[4] = "Thumb1";
+		case 4:
+			(*button_names)[3] = "Right";
+		case 3:
+			(*button_names)[2] = "Left";
+		case 2:
+			(*button_names)[1] = "Down";
+		case 1:
+			(*button_names)[0] = "Up";
+			break;
+	}
+	// add the remaining extended buttons	
+	for (i=6; i<buttons_cnt; i++)
+	{
+		snprintf(buf, 16, "ExtBt%d", i +1);
+		(*button_names)[i] = malloc(strlen(buf)+1);
+		strcpy((*button_names)[i], buf);
+	}
+}
+
+/*----------------------------------------------------------------------------*/
+
 RETSIGTYPE exitParent(int num)
 {
 	exit(0);
@@ -197,11 +228,11 @@ int isUsedButton(int b)
 	int i;
 
 	Printf("isUsedButton(%d)=",b);
-	for(i=0;i<NUM_BUTTONS;i++)
+	for(i=0;i<buttons_cnt;i++)
 		if(buttons[i]==b)
 			break;
-	Printf("%s\n",i<NUM_BUTTONS?"yes":"no");
-	return i<NUM_BUTTONS;
+	Printf("%s\n",i<buttons_cnt?"yes":"no");
+	return i<buttons_cnt;
 }
 
 /*----------------------------------------------------------------------------*/
@@ -210,10 +241,10 @@ int buttonIndex(int b)
 {
 	int i;
 
-	for(i=0;i<NUM_BUTTONS;i++)
+	for(i=0;i<buttons_cnt;i++)
 		if(buttons[i]==b)
 			return(i);
-	return(NUM_BUTTONS);
+	return(buttons_cnt);
 }
 
 /*----------------------------------------------------------------------------*/
@@ -221,6 +252,7 @@ int buttonIndex(int b)
 void getOptions(int argc, char **argv, char *opts, const struct option *options)
 {
 	int ch,i,j,killold=False,invalidOpts=False;
+	char *ButtonOpt = NULL;
 
 	while((ch=getopt_long_only(argc,argv,opts,options,&i))>=0)
 	{
@@ -297,6 +329,16 @@ void getOptions(int argc, char **argv, c
 				exit(0);
 				break;
 			case 'b':
+				for (j = 0; j < strlen(optarg); j++)
+					if (optarg[j] == ' ')
+						buttons_cnt++;
+				buttons_cnt++;
+				buttons = malloc(sizeof(int) * buttons_cnt);
+				ButtonOpt = strtok(optarg, " ");
+				for(j = 0; ButtonOpt != NULL; ButtonOpt = strtok(NULL, " "), j++)
+					buttons[j] = atoi(ButtonOpt);
+
+/*
 				memset(buttons,0,NUM_BUTTONS*sizeof(int));
 				for(j=0;optarg[j] && j<NUM_BUTTONS;j++)
 				{
@@ -307,6 +349,7 @@ void getOptions(int argc, char **argv, c
 					}
 					buttons[j]=optarg[j]-'0';
 				}
+*/
 				break;
 			case 'h':
 			case '?':
@@ -318,6 +361,12 @@ void getOptions(int argc, char **argv, c
 		}
 		Printf("\n");
 	}
+	if(buttons_cnt == 0) {
+		buttons_cnt = 6;
+		buttons = malloc(sizeof(int) * buttons_cnt);
+		for(j = 0; j < buttons_cnt; j++)
+			buttons[j] = j+4;
+	}
 	if(invalidOpts)
 		exit(1);
 	if(!restart)
@@ -526,7 +575,7 @@ void printUsage(char *pname, const struc
 	int i,maxa=0,maxb=0,len;
 	char str[80];
 
-	printf("imwheel %s by -=<Long Island Man>=- <jcatki@jonatkins.org>\n",VERSION);
+	printf("imwheel %s by -=<Long Island Man>=- <jcatki@jcatki.no-ip.org>\n",VERSION);
 	if(!options || !usage)
 		return;
 	printf("%s",pname);
@@ -862,16 +911,16 @@ struct WinAction *getRC()
 			{
 				sscanf(line+6,"%d",&i);
 				Printf("(Button%d)",i);
-				if(i>NUM_BUTTONS)
-					i=NUM_BUTTONS;
+				if(i>buttons_cnt)
+					i=buttons_cnt;
 				else
 					newwa[num_wa-1].button=i;
 			}
 			else
 			{
-				for(i=0; i<NUM_BUTTONS; i++)
+				for(i=0; i<buttons_cnt; i++)
 				{
-					if(!strcasecmp(line,button_names[i]))
+					if(!strcasecmp(line,(*button_names)[i]))
 					{
 						if(buttons[i])
 							newwa[num_wa-1].button=i+4;//buttons[i];
@@ -881,12 +930,10 @@ struct WinAction *getRC()
 					}
 				}
 			}
-			if(i==NUM_BUTTONS) // nothing found
+			if(i==buttons_cnt) // nothing found
 			{
-				if(!strncasecmp(line,button_names[4],strlen(button_names[4])-1))
-					newwa[num_wa-1].button=buttons[4];
-				else
-					exitString("Unrecognized wheel action in config.\n%s\n",line);
+				fprintf(stderr, "Unrecognized wheel action in config. Ignoring action.\n%s\n", line);
+				newwa[num_wa-1].button = 0;
 			}
 			Printf("\t=%d\n",newwa[num_wa-1].button);
 			if(!newwa[num_wa-1].button)
@@ -1092,7 +1139,7 @@ void writeRC(struct WinAction *wa)
 		perror("imwheel,writeRC");
 		return;
 	}
-	fprintf(f,"# IMWheel Configuration file (%s)\n# (C)Jon Atkins <jcatki@jonatkins.org>\n#\n# Generated by imwheel\n# Any extra comments will be lost on reconfiguration\n# However order will be maintained\n# Order!  ORDER, I SAY!!\n",fname);
+	fprintf(f,"# IMWheel Configuration file (%s)\n# (C)Jon Atkins <jcatki@jcatki.no-ip.org>\n#\n# Generated by imwheel\n# Any extra comments will be lost on reconfiguration\n# However order will be maintained\n# Order!  ORDER, I SAY!!\n",fname);
 	for(cur=NULL,p=wa;p->id;p=&p[1])
 	{
 		if(!cur || strcmp(cur->id,p->id))
@@ -1104,7 +1151,7 @@ void writeRC(struct WinAction *wa)
 		{
 			for(i=0; p->in[i]; i++)
 				fprintf(f,"%s%s",(i?"|":""),p->in[i]);
-			fprintf(f,",\t%s,\t",button_names[p->button-4]);
+			fprintf(f,",\t%s,\t",(*button_names)[p->button-4]);
 			for(i=0; p->out[i]; i++)
 				fprintf(f,"%s%s",(i?"|":""),p->out[i]);
 			if(p->delayup>0||p->delay>0||p->reps>1||p->reps==0)
--- imwheel-1.0.0pre12.orig/util.h
+++ imwheel-1.0.0pre12/util.h
@@ -10,7 +10,7 @@
 
 #define PIDFILE PIDDIR"/imwheel.pid"
 
-#define NUM_BUTTONS 6
+#define NUM_STDCOMMANDS 6
 #define STATE_MASK (ShiftMask|ControlMask|Mod1Mask|Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask)
 #define NUM_STATES 3
 #define MAX_MASKTRANS 8
@@ -42,17 +42,18 @@
 	int delayup;//microsecond delay while key down
 };
 
-extern int buttons[NUM_BUTTONS+1];
+extern int *buttons;
+extern int buttons_cnt;
 extern int statebits[STATE_MASK+1];
 extern int debug;
 extern struct WinAction *wa;
 extern int num_wa;
 extern struct Trans masktrans[MAX_MASKTRANS];
 extern const int reps[1<<NUM_STATES];
-extern const char *keys[NUM_BUTTONS][1<<NUM_STATES];
+extern const char *keys[NUM_STDCOMMANDS][1<<NUM_STATES];
 extern char *wname;
 extern XClassHint xch;
-extern const char *button_names[];
+extern char *(*button_names)[];
 extern Atom ATOM_NET_WM_NAME, ATOM_UTF8_STRING, ATOM_WM_NAME, ATOM_STRING;
 
 void getOptions(int,char**,char*,const struct option*);
@@ -66,6 +67,7 @@
 int getbit(char*, int);
 void setbit(char*, int, Bool);
 void setupstatebits(void);
+void setupbuttonnames(void);
 int isMod(XModifierKeymap*, int);
 unsigned int makeModMask(XModifierKeymap*, char[32]);
 unsigned int makeKeysymModMask(Display*,XModifierKeymap*, char**);
--- imwheel-1.0.0pre12.orig/imwheel.1
+++ imwheel-1.0.0pre12/imwheel.1
@@ -20,47 +20,56 @@
 \fB-4, --flip-buttons\fP
 Flips the mouse buttons so that 4 is 5 and 5 is 4, reversing
 the Up and Down actions.  This would make 4 buttons somewhat useful!
-This is the similar to using "-b 54678", see the \fB-b\fP option.
+This is the similar to using '-b "5 4 6 7 8"', see the \fB-b\fP option.
 See also xmodmap(1).
 .TP
 \fB-b, --buttons\fP \fIbutton-spec\fP
 Remap buttons in \fIbutton-spec\fP to interpreted wheel/thumb input.
 Also limits the button grab to the specified buttons when using the ZAxis method.
 (see "X WINDOWS ZAXIS METHOD" below)
-the \fIbutton-spec\fP may specify any of up to five buttons.
-the \fIbutton-spec\fP is decoded in the following order for wheel input:
+The \fIbutton-spec\fP must be surrounded by quotes.
+Each button number must be separated by a space.
+The \fIbutton-spec\fP is decoded in the following order for wheel input:
 .RS
 .RS
 .nf
 
-Index   Interpreted As    Button Number
+Index   Interpreted As    Button Number   Name in imwheelrc
 .br
-1       Wheel Up          4
+1       Wheel Up          4               Up
 .br
-2       Wheel Down        5
+2       Wheel Down        5               Down
 .br
-3       Wheel Left        6
+3       Wheel Left        6               Left
 .br
-4       Wheel Right       7
+4       Wheel Right       7               Right
 .br
-5       Thumb Button 1    8
+5       Thumb Button 1    8               Thumb1
 .br
-6       Thumb Button 2    9
+6       Thumb Button 2    9               Thumb2
+.br
+7       Extra Button 1    10              ExtBt7
+.br
+8       Extra Button 2    11              ExtBt8
+.br
+etc.
 
 .fi
 .RE
-A \fIbutton-spec\fP of "45" will limit the grabbed buttons for only wheel up and down.
+A \fIbutton-spec\fP of "4 5" will limit the grabbed buttons for only wheel up and down.
 .br
-A \fIbutton-spec\fP of "67" may be useful to use actual buttons 6 and 7 as wheel up
+A \fIbutton-spec\fP of "6 7" may be useful to use actual buttons 6 and 7 as wheel up
 and down, and limit the grab to only those two buttons.
 .br
 A \fIbutton-spec\fP of "0" turns off any defined mapping, thus allowing for skips in
 the \fIbutton-spec\fP for something that doesn't exist on your mouse.
 .br
-A \fIbutton-spec\fP of "45006" may be for normal wheel up/down and a thumb button 1, but
+A \fIbutton-spec\fP of "4 5 0 0 6" may be for normal wheel up/down and a thumb button 1, but
 no horizontal wheel axis.
 .br
-The default \fIbutton-spec\fP is "456789".
+The default \fIbutton-spec\fP is "4 5 6 7 8 9", but you may want or need to customize this
+for yourself. If you want to ignore the mouse wheel on regular mouse, make sure to start the
+\fIbutton-spec\fP with "0 0 ...", or "0 0 0 0 ..." on a mouse with a two-axis scroll wheel.
 .br
 See also xmodmap(1).
 .RE
@@ -95,23 +104,12 @@
 .TP
 \fB-k, --kill\fP
 Attempts to kill old imwheel (useful only for \fB--wheel-fifo\fP method.)
-Pidfile must be created for this to work (no \fB-p\fP or \fB--pid\fP option on
-the previous imwheel invocation).  Process IDs are
-tested using /proc/${pid}/status Name: field ?= imwheel. 
+Process IDs are tested using /proc/${pid}/status Name: field ?= imwheel. 
 If /proc is not mounted then this fails everytime!
 Otherwise, this ensures that the wrong process is not killed.
 .TP
-\fB-p, --pid\fP
-Don't write a pid file for gpmwheel FIFO method.  This is the only
-method that uses the pid file.  XGrab doesn't need it, so it just
-issues a warning about starting multiple imwheels on the same
-display.  Some people really prefer this, especially when they are
-not using a SUID root imwheel executable.
-.TP
 \fB-q, --quit\fP
-Quit imwheel before entering event loop.  Usful in killing an
-imwheel running in gpmwheel FIFO mode after exiting XWindows,
-if you're using pid files that is.
+Quit imwheel before entering event loop.
 .br
 Example: `imwheel -k -q' = kill and quit (option order doesn't matter)
 .TP
@@ -242,9 +240,6 @@
 own purposes.  The supplied imwheelrc included and exclusion for XV already.  
 See the IMWheelRC section for more information.
 .LP
-Also pid files are not used for this method.  Thus the \fB-p\fP and \fB--pid\fP
-options have no effect, and are ignored.
-.LP
 .SH "GPM/JAMD WHEEL FIFO METHOD"
 This method is REQUIRED for any X Windows server without wheel
 mouse support built in.  This method will currently support mice as supported
@@ -475,6 +470,9 @@
 Right  is button 7
 Thumb1 is button 8
 Thumb2 is button 9
+ExtBt7 is button 10
+ExtBt8 is button 11
+etc.
 .fi
 .RE
 .RE
@@ -561,6 +559,9 @@
 Button7  Right          Mouse Wheel Right
 Button8  Thumb1         Side Mouse Button 1 (left/up)
 Button9  Thumb2         Side Mouse Button 2 (right/down)
+Button10 ExtBt7         Extra Mouse Button 1
+Button11 ExtBt8         Extra Mouse Button 2
+etc.
 .ni
 .RE
 .LP
@@ -658,12 +659,12 @@
 .LP
 .SH "HOMEPAGE"
 .nf
-http://jonatkins.org/imwheel
+http://imwheel.sourceforge.net
 .fi
 
 .LP
 .SH "AUTHOR"
-Jonathan Atkins <jcatki@jonatkins.org>
+Jonathan Atkins <jcatki@jcatki.no-ip.org>
 
 .LP
 .SH "FILES"
@@ -685,12 +686,6 @@
 	one instance of imwheel to be running on the same computer
 	when running imwheel on multiple displays
 	using the Wheel FIFO method.
-
-/tmp/imwheel.pid
-	The public area for imwheel's pid file.
-
-/var/run/imwheel.pid
-	The private area for imwheel's pid file.
 .fi
 
 .LP
--- imwheel-1.0.0pre12.orig/imwheel.c
+++ imwheel-1.0.0pre12/imwheel.c
@@ -69,7 +69,7 @@
 const char *optionusage[][2]=
 { /*{argument name,		usage}*/
 	{"delay-rate",		"auto repeat until button release (default=250)"},			//a
-	{"grab-buttons",	"Specify up to 6 remappings 0=none (default=456789)"},		//b
+	{"grab-buttons",	"Specify button remappings 0=none (default=\"4 5 6 7 8 9\")"},//b
 	{NULL,				"Open configuration helper window imediately"},				//c
 	{NULL,				"Spit out all debugging info (it's a lot!)"},				//D
 	{NULL,				"IMWHeel process doesn't detach from terminal"},			//d
@@ -108,6 +108,7 @@
 
 	getOptions(argc,argv,opts,options);
 	setupstatebits();
+	setupbuttonnames();
 	if(!displayName)
 		displayName=XDisplayName(NULL);
 	Printf("display=%s\n",displayName);
@@ -137,7 +138,7 @@
 		return;
 	Printf("Grab buttons!\n");
 	grabbed=True;
-	for(i=0;i<NUM_BUTTONS;i++)
+	for(i=0;i<buttons_cnt;i++)
 	{
 		if(buttons[i])
 		{
@@ -168,7 +169,7 @@
 	Printf("Ungrab buttons!\n");
 	XSync(d,False);
 	grabbed=False;
-	for(i=0;i<NUM_BUTTONS;i++)
+	for(i=0;i<buttons_cnt;i++)
 	{
 		if(buttons[i])
 		{
@@ -331,7 +332,7 @@
 	{
 		//e->xbutton.button^=buttonFlip;
 		button= buttonIndex(e->xbutton.button);
-		if(button<NUM_BUTTONS)
+		if(button<buttons_cnt)
 			e->xbutton.button= button= button+4;
 		XQueryKeymap(d,km);
 		if(debug)
@@ -635,9 +636,9 @@
 						int k;
 
 						j=button-4;
-						if(j>=NUM_BUTTONS)
+						if(j>=buttons_cnt)
 						{
-							Printf("No we aren't because j(%d) is >= NUM_BUTTONS(%d)!\n",j,NUM_BUTTONS);
+							Printf("No we aren't because j(%d) is >= NUM_BUTTONS(%d)!\n",j,buttons_cnt);
 							break;
 						}
 						k=statebits[makeModMask(xmk,km)&STATE_MASK];
@@ -647,6 +648,11 @@
 							break;
 						}
 						
+						// simply cut off all new buttons and map the odd ones to "Thumb1" and
+						// the even ones to "Thumb2"
+						if (j>NUM_STDCOMMANDS) // we have NUM_STDCOMMANDS standard actions
+							j = 5 - (j % 2); // all odds become a 4, all evens a 5
+						
 						out[0]=(char*)keys[j][k];
 						wa.reps=reps[k];
 						doWA(d,(XButtonEvent*)&e.xbutton,xmk,km,&wa);
--- imwheel-1.0.0pre12.orig/ChangeLog
+++ imwheel-1.0.0pre12/ChangeLog
@@ -1,398 +1,476 @@
+1.0.0pre12:
+	deprecate -p to do nothing, except print a message.
+	scan /proc/[0-9]*/stat for imwheel process to kill on -k
+		(* Security Fix *)
+		http://www.caughq.org/advisories/CAU-2004-0002.txt
+	fixed make distcheck
+
+1.0.0pre11:
+	avoid bad events that cause an infinite loop!
+
+1.0.0pre10:
+	fix @Exclude (argh)
+		this allows xv->grab to function normally again, with the right config.
+	when configuring, error when we can't link to X11
+		apparently too many idiots can't read warnings.
+	at this point all bugs are fixed and all acceptable additions to functionality
+		are finished...
+	if there are no reports within a few weeks, 1.0.0 will be released with
+		full documentation updates, and imwheel itself will be put to rest,
+		except for bug fixes.
+		(until I decided to do a total rewrite in a simpler, yet more powerful, manner.)
+
+1.0.0pre9:
+	default action is now @Repeat,
+		so wheel-active applications get the right stuff
+		imwheel is meant for OLD apps...so in keeping with that
+			now that most modern apps can handle the wheel for real
+			it's time to remove the builtin keys...
+			however the old method of default keys is still available
+			via the -K option
+	-K now uses doWA routine, just like user configured actions do
+	
+1.0.0pre8:
+	added Button# syntax for input filter in imwheelrc
+		like Up can now be called Button4, Down can be Button5, etc...
+		(Left=6, Right=7, Thumb1=8, Thumb2=9, like always...)
+	squashed a segfault
+	fixed UNGRAB window name, class, and resource name resolution (used to get "(null)"s)
+	gpm is no longer built by default
+	gpm's docs are no longer built by default
+
+1.0.0pre7:
+	search parent windows for a name, this should remove the need for -f.
+
+1.0.0pre6:
+	fix -b
+		With some help from Malte S. Stretz <mss AT msquadrat.de>
+	example: -b 4589
+		will use button 4 and 5 as Up and Down like normal
+		will use button 8 and 9 as Left and Right, remapped
+		button 6 and 7 are ignored.
+		all imwheel entries that are Thumb1 and Thumb2 events will ne discarded
+	fix window name lookup, now uses XAtoms 
+		Thanks Mark Baker <homer1 AT adelphia.net>
+	first tries _NET_WM_NAME(UTF8_STRING) if these Atoms are present
+		- whether UTF8 works in the imwheelrc...I do not know.
+	if that's NULL then it tries WM_NAME(STRING) if these Atoms are present
+	if that's still NULL then then it tries the old method...
+	avoid a possible segfault...dunno if it happens in the real world
+
+1.0.0pre5:
+	added --auto-repeat inspired by a debian patch from 
+		Thanks Darren Salt <linux AT youmustbejoking.demon.co.uk>
+		http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=173964&msg=1
+		the code is untested, so all you stick users out there better test the stuff
+		and help debug it too!
+	if you set a repeat number to 0 for an action in the rc file,
+		then it will do autorepeat for as long as that button is held, I hope.
+	hid some warnings/infos/perrors behind -d debugging mode.
+	moved the system imwheelrc to /etc/X11/imwheel/imwheelrc
+
 1.0.0.pre4:
-    "\(root\)" works for non-wheel-fifos, as long as @Exclude isn't used.
-        instead use :
-            "\(root\)"
-            ,Up,Button4
-            ,Down,Button5
-        etc... in your imwheelrc.
-    added mid-sequence keyups, put a - befreo the keysym for a keyup like this:
-            ".*"
-            ,Up,Shift_L|R|-R|-Shift_L|O|-O|F|-F|L|-L|Return
-        this will type "Rofl" and press return, in all apps, on wheel up.
-        make sure not to press something twice in a row without releasing it.
-    
+	"\(root\)" works for non-wheel-fifos, as long as @Exclude isn't used.
+		instead use :
+			"\(root\)"
+			,Up,Button4
+			,Down,Button5
+		etc... in your imwheelrc.
+	added mid-sequence keyups, put a - befreo the keysym for a keyup like this:
+		".*"
+		,Up,Shift_L|R|-R|-Shift_L|O|-O|F|-F|L|-L|Return
+		this will type "Rofl" and press return, in all apps, on wheel up.
+		make sure not to press something twice in a row without releasing it.
+
 1.0.0.pre3:
-    added the --root-window (-r) option, for WM wheeling in the root of the
-    XServer.  use pattern "\(root\)" in the imwheelrc file.
+	added the --root-window (-r) option, for WM wheeling in the root of the
+		XServer.  use pattern "\(root\)" in the imwheelrc file.
 
 1.0.0pre2:
-    added --config (-c) option, open config window at start
-    added Button sending via XTest, use Button# as keysym in imwheelrc.
-    one less error on failing to open an empty filename
-    Thumb1 and Thumb2 (two thumb buttons) (Thumb == Thumb1)
-    README is no longer going to be updated, use the manpage after installation.
-    
-1.0.0pre1:
-    updated for gcc3.0
-    fixed configure dialog for XServer depth >16bits.
-        (please report if the configure dialog still fails for you now)
-    removed ye olde Makefile.unix
+	added --config (-c) option, open config window at start
+	added Button sending via XTest, use Button# as keysym in imwheelrc.
+	one less error on failing to open an empty filename
+	Thumb1 and Thumb2 (two thumb buttons) (Thumb == Thumb1)
+	README is no longer going to be updated, use the manpage after installation.
 
+1.0.0pre1:
+	updated for gcc3.0
+	fixed configure dialog for XServer depth >16bits.
+	(please report if the configure dialog still fails for you now)
+	removed ye olde Makefile.unix
+-------------------------------------------------------------------------------
 0.9.9:
-    Documentation needs updating with the features from this release...argh!
-    Made some more comments in the stderr output...plus hints.
-    Fixed a segfault on freeing a few strings that were not allocated.
-    Added -g option for focus event tracking, so we at least try to regrab
-      whenever the focused (ungrabbed) window is left.
-        this was code from Patrick Reinelt <preinelt@kullen.rwth-aachen.de>
-        -g toggles it on an off, but it is on by default, as it may help some
-            people out there.
-  pre6
-    This may be the last update to the 0.9.9, pending any bugs.
-    CVS dirs removed in make dist process...
-    Upgraded GPM to version 1.19.3 and generated the patch as usual.
-    Added Artec UM530P driver (-t um530p) to gpm.
-        This is the imps2 init code without the second half.
-        Thanks to: Vicente Aguilar <vaguilar@linuxfreak.com>
-    Fixed some references to O_SYNC for FreeBSD users, who don't have it!
-    Reduced the fontspec in cfg.c to be more forgiving, may avert a SegFault!
-    Added an RPM Source spec file...it might work, I dunno!
-    imwheelrc now installs into /etc for "make install"
-    Added -Igetopt for when included getopt is used.
-    Added a transpose (-x) option to swap the X/Y axis.
-        Useful for S-48 OEM gpm driver, also use -b 54 option...
-        This is for fifo use only, which is working fine in XFree86 4.0.1
-    Added more sanity checks in configure.in 
-        getopt.h missing causes the included one to be used
-        XFree86 only checked for Linux systems
-    Added Linux Touch Panel Drivers for the Fujitsu Lifebook B112/B142
-        GPM driver to imwheel's gpm (-t b112)
-        Thanks to Harald Hoyer <Harald.Hoyer@Parzelle.De> <HarryH@Royal.Net>
-            who had the patches for gpm on his site http://parzelle.de/
-    Added Logitech OEM S-48 & Firstmouse+ to gpm (-t zilog)
-        This works for a Logitech OEM S-48 that I received as a donation
-        Thanks to A. Norman <norman@physics.wm.edu> posting his sourcecode!
-            His site is at:
-              http://www.physics.wm.edu/~norman/Mouse_Diag/index.html
-    Added a script to convert the Right-handedly oriented imwheelrc file to
-        Left handed (converts _L to _R in the imwheelrc)
-        It's simple so patterns matching the _L string will be changed to _R
-            watch out for that I suppose...but I haven't seen anything like
-            that in other places of the rc file.
-        The script is called lefty.sh, execute it before "make install" if you
-            are a left handed person or you prefer the right side control keys.
-  pre5
-    Replaced strsep usage for intel solaris people.
-    Fixed the fact that a missing "(null)" section would cause a segfault.
-    Fixed an UNGRAB(Exclude) handling code error.
-    Optimized the UNGRAB/GRAB search, now we don't go looking for a reason not
-        to UNGRAB all the time!
-    Added --buttons or -b option, whichs allows you to set the button mapping.
-        Default mapping looks like this: "45678"
-        You can limit it to just 4 and 5 by doing: imwheel -b 45
-        This also allows some people to fix the mapping for weirdo mice ;)
-        Here's a reference table for what the numbers mean:
-
-            index    default button    action in imwheel
-              1             4           Wheel/Stick Up
-              2             5           Wheel/Stick Down
-              3             6           Wheel/Stick Left
-              4             7           Wheel/Stick Right
-              5             8           Thumb Button
-
-        So that "imwheel -b 86754" does the following:
-            Button 8 is Wheel/Stick Up to imwheel
-            Button 6 is Wheel/Stick Down to imwheel
-            Button 7 is Wheel/Stick Left to imwheel
-            Button 5 is Wheel/Stick Right to imwheel
-            Button 4 is Thumb Button to imwheel
-        Use xev while NOT running imwheel (run "imwheel -kq" first) to find out
-            what buttons are what on your mouse!
-    Fixed the non-functional Configure Dialog (XGrabButton wasn't working right)
-  pre4
-    Fixed == tests to = in configure.in, per many complaints. (worked for me ;)
-    Updated gpm to version 1.19.2, people kept asking...
-  pre3
-    Fixed security bug, where a user may symlink to a file they cannot open as
-        themselves, then get the first line of that file using the debug mode.
-        This could allow the root password of the shadow to be exposed for any
-        user who has access to a set-uid-root imwheel.
-        Apparently Mandrake (and others perhaps) use a suid-root perl script to
-        execute the imwheel program, perhaps meaning to be more safe.  In
-        reality I do not install imwheel as root, nor do I actively support it,
-        nor take any responsibility for those who do install it as a suid-root
-        or suid any other user, and who then have a security breach.  I'm also
-        happy that my friend, Rob C. Ludwick, pointed the hole out to me, as
-        no-one on the mailing list he saw this being discussed on bothered to
-        write me!  Also, about the distros suid perl script jazz...this is the
-        second time you've caused me pain, and I'm bitter, and I have no remorse
-        for you if you shall perish one million deaths through your foolishness
-        of suid-root wrappers.
-    One other note, imwheel already DOES check that any process it is looking
-        to kill is actually an imwheel process.  If this needs improvement
-        then somebody send in a patch.  I currently consider the possibility
-        impossible.  (Yes, I like English!)
-  pre2
-    Added @Priority to allow for people who want visible control over what is
-        more important than whatever else.  See imwheelrc for more. (tested)
-    Fixed the @Exclude bug, where if @Exclude was used with a ".*" regex then
-        all windows were excluded, even those defined in the imwheelrc.
-        The new priority command can help users tell imwheel how much they'd
-        really like to exclude and what doesn't need to be, otherwise position
-        in the imwheelrc is all that makes the difference now. (tested)
-    Fixed the configuration errors, where variables were unquoted and spaces
-        may have freaked m4 and the shell out!
-  pre1
-    fixed getenv("HOME") type security hole. (tested)
-    inclusion of imwheelrc, but no "make install" installation yet.
---------------------------------------------------------------------------------
+	Documentation needs updating with the features from this release...argh!
+	Made some more comments in the stderr output...plus hints.
+	Fixed a segfault on freeing a few strings that were not allocated.
+	Added -g option for focus event tracking, so we at least try to regrab
+		whenever the focused (ungrabbed) window is left.
+		this was code from Patrick Reinelt <preinelt@kullen.rwth-aachen.de>
+	-g toggles it on an off, but it is on by default, as it may help some
+	people out there.
+	
+pre6
+	This may be the last update to the 0.9.9, pending any bugs.
+	CVS dirs removed in make dist process...
+	Upgraded GPM to version 1.19.3 and generated the patch as usual.
+	Added Artec UM530P driver (-t um530p) to gpm.
+		This is the imps2 init code without the second half.
+		Thanks to: Vicente Aguilar <vaguilar@linuxfreak.com>
+	Fixed some references to O_SYNC for FreeBSD users, who don't have it!
+	Reduced the fontspec in cfg.c to be more forgiving, may avert a SegFault!
+	Added an RPM Source spec file...it might work, I dunno!
+	imwheelrc now installs into /etc for "make install"
+	Added -Igetopt for when included getopt is used.
+	Added a transpose (-x) option to swap the X/Y axis.
+		Useful for S-48 OEM gpm driver, also use -b 54 option...
+		This is for fifo use only, which is working fine in XFree86 4.0.1
+	Added more sanity checks in configure.in 
+		getopt.h missing causes the included one to be used
+		XFree86 only checked for Linux systems
+	Added Linux Touch Panel Drivers for the Fujitsu Lifebook B112/B142
+		GPM driver to imwheel's gpm (-t b112)
+		Thanks to Harald Hoyer <Harald.Hoyer@Parzelle.De> <HarryH@Royal.Net>
+			who had the patches for gpm on his site http://parzelle.de/
+	Added Logitech OEM S-48 & Firstmouse+ to gpm (-t zilog)
+		This works for a Logitech OEM S-48 that I received as a donation
+		Thanks to A. Norman <norman@physics.wm.edu> posting his sourcecode!
+			His site is at:
+				http://www.physics.wm.edu/~norman/Mouse_Diag/index.html
+	Added a script to convert the Right-handedly oriented imwheelrc file to
+		Left handed (converts _L to _R in the imwheelrc)
+		It's simple so patterns matching the _L string will be changed to _R
+		watch out for that I suppose...but I haven't seen anything like
+		that in other places of the rc file.
+	The script is called lefty.sh, execute it before "make install" if you
+		are a left handed person or you prefer the right side control keys.
+
+pre5
+	Replaced strsep usage for intel solaris people.
+	Fixed the fact that a missing "(null)" section would cause a segfault.
+	Fixed an UNGRAB(Exclude) handling code error.
+	Optimized the UNGRAB/GRAB search, now we don't go looking for a reason not
+		to UNGRAB all the time!
+	Added --buttons or -b option, whichs allows you to set the button mapping.
+		Default mapping looks like this: "45678"
+		You can limit it to just 4 and 5 by doing: imwheel -b 45
+		This also allows some people to fix the mapping for weirdo mice ;)
+		Here's a reference table for what the numbers mean:
+
+		index    default button   action in imwheel
+		1             4           Wheel/Stick Up
+		2             5           Wheel/Stick Down
+		3             6           Wheel/Stick Left
+		4             7           Wheel/Stick Right
+		5             8           Thumb Button
+
+	So that "imwheel -b 86754" does the following:
+		Button 8 is Wheel/Stick Up to imwheel
+		Button 6 is Wheel/Stick Down to imwheel
+		Button 7 is Wheel/Stick Left to imwheel
+		Button 5 is Wheel/Stick Right to imwheel
+		Button 4 is Thumb Button to imwheel
+	Use xev while NOT running imwheel (run "imwheel -kq" first) to find out
+		what buttons are what on your mouse!
+	Fixed the non-functional Configure Dialog (XGrabButton wasn't working right)
+
+pre4
+	Fixed == tests to = in configure.in, per many complaints. (worked for me ;)
+	Updated gpm to version 1.19.2, people kept asking...
+
+pre3
+	Fixed security bug, where a user may symlink to a file they cannot open as
+		themselves, then get the first line of that file using the debug mode.
+	This could allow the root password of the shadow to be exposed for any
+		user who has access to a set-uid-root imwheel.
+	Apparently Mandrake (and others perhaps) use a suid-root perl script to
+		execute the imwheel program, perhaps meaning to be more safe.  In
+		reality I do not install imwheel as root, nor do I actively support it,
+		nor take any responsibility for those who do install it as a suid-root
+		or suid any other user, and who then have a security breach.  I'm also
+		happy that my friend, Rob C. Ludwick, pointed the hole out to me, as
+		no-one on the mailing list he saw this being discussed on bothered to
+		write me!  Also, about the distros suid perl script jazz...this is the
+		second time you've caused me pain, and I'm bitter, and I have no remorse
+		for you if you shall perish one million deaths through your foolishness
+		of suid-root wrappers.
+	One other note, imwheel already DOES check that any process it is looking
+		to kill is actually an imwheel process.  If this needs improvement
+		then somebody send in a patch.  I currently consider the possibility
+		impossible.  (Yes, I like English!)
+
+pre2
+	Added @Priority to allow for people who want visible control over what is
+		more important than whatever else.  See imwheelrc for more. (tested)
+	Fixed the @Exclude bug, where if @Exclude was used with a ".*" regex then
+		all windows were excluded, even those defined in the imwheelrc.
+		The new priority command can help users tell imwheel how much they'd
+		really like to exclude and what doesn't need to be, otherwise position
+		in the imwheelrc is all that makes the difference now. (tested)
+	Fixed the configuration errors, where variables were unquoted and spaces
+		may have freaked m4 and the shell out!
+
+pre1
+	fixed getenv("HOME") type security hole. (tested)
+		inclusion of imwheelrc, but no "make install" installation yet.
+-------------------------------------------------------------------------------
 0.9.8
-    finished configure "make dist" handling of unselected stuff.
-    seems to work well for all beta testers (at least 5 people wrote back)
-  pre4
-    fixed @Exclude (tested myself of course, waiting for feedback)
-    fixed PIDFILE crap from making the configure.in wrongly...
-        hey - I'm still learning autoconfig and friends... ;)
-  pre3
-    configure (full autoconf, automake, autoheader dealie)
-    updated gpm to version 1.19.0
-    added -v and --version option, for just the version header of the help
-    there will be NO MORE none gpm releases until gpm includes my patch in the
-        main distribution!  configure doesn't play nice doing dual distros...
-  pre2
-    updated gpm to version 1.18.1
-  pre1
-    tfxmms - in gpm - the Serial Trackman FX marble button 4 as stick motion
-                      toggle and complete mouse driver.
-    sensitivity option in imwheel - uses a summation of motion after
-                                    thresholding, to determine when to go!
-    @Repeat command (like @Exclude) in imwheelrc files - resends the button to X
-        this may not work for non-gpm wheelfifo users, who should rather use
-        @Exclude for now.
-    minor code cleanups - no bugfixes there!  just making code better looking.
---------------------------------------------------------------------------------
+	finished configure "make dist" handling of unselected stuff.
+	seems to work well for all beta testers (at least 5 people wrote back)
+
+pre4
+	fixed @Exclude (tested myself of course, waiting for feedback)
+	fixed PIDFILE crap from making the configure.in wrongly...
+	hey - I'm still learning autoconfig and friends... ;)
+
+pre3
+	configure (full autoconf, automake, autoheader dealie)
+	updated gpm to version 1.19.0
+	added -v and --version option, for just the version header of the help
+	there will be NO MORE none gpm releases until gpm includes my patch in the
+	main distribution!  configure doesn't play nice doing dual distros...
+
+pre2
+	updated gpm to version 1.18.1
+
+pre1
+	tfxmms - in gpm - the Serial Trackman FX marble button 4 as stick motion
+	toggle and complete mouse driver.
+	sensitivity option in imwheel - uses a summation of motion after
+		thresholding, to determine when to go!
+	@Repeat command (like @Exclude) in imwheelrc files - resends the button to X
+		this may not work for non-gpm wheelfifo users, who should rather use
+		@Exclude for now.
+	minor code cleanups - no bugfixes there!  just making code better looking.
+-------------------------------------------------------------------------------
 0.9.7
-    Added --force option to force usage of event data instead of looking for
-      the focused window using XGetInputFocus.  This may work better for some
-      window managers than others.  In fvwm2 I do not use the force option,
-      whereas in window maker it may be mandatory.  I know it's silly but when
-      you use the force option you are using the ICCCM method of grabbing the
-      current client window, whereas the deffault operation uses the original
-      XGetInputFocus method.  All you need to know is that if the debug output
-      keeps showing the the window title as null, then toggle this option and
-      it may work correctly.  Please report back to me on window managers and
-      whether the force option was required or not to work correctly with
-      imwheel.  This method was sparked by Brian Craft <bcboy@cisco.com>.
-    Fixed a bug where if the winid was not being copied into a correctly sized
-      space, therefore causing segfaults when reading an rc like this...
-      
-      ".*\.[pP][dD][fF]"
-      Alt_L,Up,Up
-
-      Note that the window match string is longer than the keydef line.  This
-      is when this bug would rear it's ugly head.  It was a dead-in-the-head
-      bug that I'm sorry I ever caused to anyone who suffered while making a
-      customized rc file.  I'm just amazed that I never ran into it in my time!
-      This bug was noted by Karoly Segesdi <vrm@scene-hu.com> if not
-      by others as well!  (But he got me closest to finding the problem by
-      giving me an imwheelrc file that consistently caused a segfault)
-      
-    Fixed a bug where imwheel whould exit when the fifo it was reading for the
-      wheel-fifo method was closed and reopened and then written from the other
-      side (from gpm or jam restarting).
-    Upgraded to gpm-1.18.0
-    Added marblefx support to gpm from Ric Klaren <klaren@cs.utwente.nl>,
-      untested as I don't have a marblefx.  It looked good though!
-    Added Primax CyberNavigator [1] mouse to gpm from Alexios Chouchoulas
-      <alexios@vennea.demon.co.uk>.  This is also untested for the same reason.
-    Added left handers Method#1 xmodmap config sent in from
-      Marc-Aurèle DARCHE <ma.darche@stellarx.com> to README and manpage.
-    And of course other misc. bugfixes, etc...that I've forgotten over time!
---------------------------------------------------------------------------------
+	Added --force option to force usage of event data instead of looking for
+		the focused window using XGetInputFocus.  This may work better for some
+		window managers than others.  In fvwm2 I do not use the force option,
+		whereas in window maker it may be mandatory.  I know it's silly but when
+		you use the force option you are using the ICCCM method of grabbing the
+		current client window, whereas the deffault operation uses the original
+		XGetInputFocus method.  All you need to know is that if the debug output
+		keeps showing the the window title as null, then toggle this option and
+		it may work correctly.  Please report back to me on window managers and
+		whether the force option was required or not to work correctly with
+		imwheel.  This method was sparked by Brian Craft <bcboy@cisco.com>.
+	Fixed a bug where if the winid was not being copied into a correctly sized
+		space, therefore causing segfaults when reading an rc like this...
+			".*\.[pP][dD][fF]"
+			Alt_L,Up,Up
+	Note that the window match string is longer than the keydef line.  This
+		is when this bug would rear it's ugly head.  It was a dead-in-the-head
+		bug that I'm sorry I ever caused to anyone who suffered while making a
+		customized rc file.  I'm just amazed that I never ran into it in my time!
+		This bug was noted by Karoly Segesdi <vrm@scene-hu.com> if not
+		by others as well!  (But he got me closest to finding the problem by
+		giving me an imwheelrc file that consistently caused a segfault)
+	Fixed a bug where imwheel whould exit when the fifo it was reading for the
+		wheel-fifo method was closed and reopened and then written from the other
+		side (from gpm or jam restarting).
+	Upgraded to gpm-1.18.0
+	Added marblefx support to gpm from Ric Klaren <klaren@cs.utwente.nl>,
+		untested as I don't have a marblefx.  It looked good though!
+	Added Primax CyberNavigator [1] mouse to gpm from Alexios Chouchoulas
+		<alexios@vennea.demon.co.uk>.  This is also untested for the same reason.
+	Added left handers Method#1 xmodmap config sent in from
+		Marc-Aurèle DARCHE <ma.darche@stellarx.com> to README and manpage.
+	And of course other misc. bugfixes, etc...that I've forgotten over time!
+
 0.9.6
-    Initial support & drivers (gpm & imwheel) for IBM ScrollPoint Mouse
-      It is the mm+ps2 mouse type in gpm
-      the IBM ScrollPoint PS/2 mouse uses the MouseManPlus Protocol in XFree86
-      Support for up and down only for now...I must do a bit before other
-       directions are considered! (for stick type mice thingers.)
-      Pressing continuously will only result in one action.  Release and press
-       again to scroll another notch.  (the regular scroll events come in too
-       fast to be useful yet...)
-      THANKS!!!!! TO Felix Klock for the ScrollPoint Mouse he MAILED ME!!!
-       This driver is due to the initiative and sacrifice of a few bucks to get
-       support for a mouse this guy loves...and from what I've read on newgroups
-       many others also love!  Well you owe the possibility of this driver to
-       Bryan for mailing me a mouse to be able to actually hack on the real
-       thing.  Now continued support is guaranteed as well!
-       mail your appreciation to Felix S Klock at pnkfelix@mit.edu
-       He paid $23 or so for the mouse plus shipping to me (with normal 32cent
-       stamps no less...due to the effects of the 1cent price increase in stamps
-       I'm sure he was kinda glad to be rid of some of his 32cent stash to make
-       room for the 33cent ones!)  Please consider sending him a dollar for his
-       effort since you are reaping the rewards... (and hey send me a dollar! :)
-    Added mdump, a program to dump the mouse port, and anything else you want
-      with a bitwise breakdown and a 3 byte per line dump.  Other interpretation
-      is added for assumptions of what may be happening with mouse motions.
-      I used this program to create the mm+ps2 driver for gpm.  It is not
-      installed by 'make install' so copy it yourself if you're interested.
-      the first arg on the command-line is taken to be the path of the mouse
-      device, which defaults to /dev/mouse.  The second arg is how many bytes
-      to dump per grab. This defaults to 3 but 4 is another common value to try.
-      The third arg is not parsed but if present the first byte will be bit
-      dumped like the rest of the bytes in a packet.
-      You can also use this program to see the MHz speed for your mouse!
-      e.g.:  mdump /dev/psaux 4 1   (for imps2 mouse device type)
-             mdump /dev/psaux 3 1   (for ps2/mouseman+ mouse device types)
-    Added to mouse-mode setup programs for the intellimouse and mouseman plus.
-      running these programs sends the right control codes to the mouse to
-      activate the intellimouse or mouseman plus protocol.  The intellimouse and
-      mouseman plus both default to ps2 mode.  the intellimouse and mouse man
-      plus both support the imps2 protocol.  some mouse man plus type mice may
-      not be intellimouse capable, but the IBM scrollpoint was capable of this
-      mode, restricting it to up and down wheel emulation on it's stick.  To
-      reset mouse run setps2.  setimps2 is for the intellimouse protocol.
-      setmmplus is for the mouseman plus protocol.  us getmdt to see the mouse's
-      reponse to the mouse device type probe.  The codes I've seen are as
-      follows (<nn> is in hex format):
-        <00>  mouseman plus (3 byte packets)
-        <03>  intellimouse  (4 byte packets)
-        <00>  plain ps2     (3 byte packets)
-                when mouse is this, <AA> is received also after an <FA>
-      Any <FA> type codes are ignored mouse responses, usually confirmation of
-      the mouse receiving the controls the program sends it.
-    All these debugging  programs default to the /dev/mouse device node unless a
-      path is passed in as the first argument.
-    None of the debugging programs have been tested with serial mice.
-    Fixed a missed regrab of the mouse after the configurator is closed.
-    Pid file is only used if user is using the /dev/gpmwheel FIFO. (Method #2)
-    Killing pids according to pidfile now checks to make sure the process is
-      truely an imwheel process, and only kills it if it is an imwheel process.
-      It also will only kill if using the /dev/gpmwheel FIFO.
-    Imwheel funtions correctly on multiple displays by using the -display
-      option or setting the DISPLAY environment variable (use export/setenv!)
-    Thanks to Arnd Bergmann <arnd@uni.de> we now have gpm support for the
-      Knopex Wineasy 4D mouse.  And due to his patches and them prompting me to
-      update lotsa code we have support for intellimouse serial, as well as
-      support for sideways actions.  This is only available through the FIFO.
-      You must use Method#2 (a variant of which that is) that uses the wheel
-      FIFO as set up by gpm.  XWindows cannot handle the 7 buttons correctly,
-      it can only handle 5, which means only up and down will work with
-      Method #1!
-    Added FreeBSD support, see the FREEBSD file for more.  It requires no
-      changes to compile and install.
-    Added threshhold option for stick users of method #2 (it requires gpm)
-      Use the -t or --threshhold option to set a threshhold from 0-7.
-      The default is 2, it works well.
-    Added no-middle-button option (-n) to gpm.  Use this if you have trouble
-      with unintentional middle button clicks while wheeling/sticking, and you
-      would rather use Emulate3Buttons chording in X (XFree86 at least...)
-    Added conditional compile for gpm-imwheel directory.
-    Added a full manpage.
---------------------------------------------------------------------------------
+	Initial support & drivers (gpm & imwheel) for IBM ScrollPoint Mouse
+		It is the mm+ps2 mouse type in gpm
+		the IBM ScrollPoint PS/2 mouse uses the MouseManPlus Protocol in XFree86
+		Support for up and down only for now...I must do a bit before other
+		directions are considered! (for stick type mice thingers.)
+	Pressing continuously will only result in one action.  Release and press
+		again to scroll another notch.  (the regular scroll events come in too
+		fast to be useful yet...)
+	THANKS!!!!! TO Felix Klock for the ScrollPoint Mouse he MAILED ME!!!
+		This driver is due to the initiative and sacrifice of a few bucks to get
+		support for a mouse this guy loves...and from what I've read on newgroups
+		many others also love!  Well you owe the possibility of this driver to
+		Bryan for mailing me a mouse to be able to actually hack on the real
+		thing.  Now continued support is guaranteed as well!
+		mail your appreciation to Felix S Klock at pnkfelix@mit.edu
+		He paid $23 or so for the mouse plus shipping to me (with normal 32cent
+		stamps no less...due to the effects of the 1cent price increase in stamps
+		I'm sure he was kinda glad to be rid of some of his 32cent stash to make
+		room for the 33cent ones!)  Please consider sending him a dollar for his
+		effort since you are reaping the rewards... (and hey send me a dollar! :)
+	Added mdump, a program to dump the mouse port, and anything else you want
+		with a bitwise breakdown and a 3 byte per line dump.  Other interpretation
+		is added for assumptions of what may be happening with mouse motions.
+		I used this program to create the mm+ps2 driver for gpm.  It is not
+		installed by 'make install' so copy it yourself if you're interested.
+		the first arg on the command-line is taken to be the path of the mouse
+		device, which defaults to /dev/mouse.  The second arg is how many bytes
+		to dump per grab. This defaults to 3 but 4 is another common value to try.
+		The third arg is not parsed but if present the first byte will be bit
+		dumped like the rest of the bytes in a packet.
+		You can also use this program to see the MHz speed for your mouse!
+			e.g.:  mdump /dev/psaux 4 1   (for imps2 mouse device type)
+			mdump /dev/psaux 3 1   (for ps2/mouseman+ mouse device types)
+	Added to mouse-mode setup programs for the intellimouse and mouseman plus.
+		running these programs sends the right control codes to the mouse to
+		activate the intellimouse or mouseman plus protocol.  The intellimouse and
+		mouseman plus both default to ps2 mode.  the intellimouse and mouse man
+		plus both support the imps2 protocol.  some mouse man plus type mice may
+		not be intellimouse capable, but the IBM scrollpoint was capable of this
+		mode, restricting it to up and down wheel emulation on it's stick.  To
+		reset mouse run setps2.  setimps2 is for the intellimouse protocol.
+		setmmplus is for the mouseman plus protocol.  us getmdt to see the mouse's
+		reponse to the mouse device type probe.  The codes I've seen are as
+		follows (<nn> is in hex format):
+			<00>  mouseman plus (3 byte packets)
+			<03>  intellimouse  (4 byte packets)
+			<00>  plain ps2     (3 byte packets)
+		when mouse is this, <AA> is received also after an <FA>
+	Any <FA> type codes are ignored mouse responses, usually confirmation of
+		the mouse receiving the controls the program sends it.
+	All these debugging  programs default to the /dev/mouse device node unless a
+		path is passed in as the first argument.
+	None of the debugging programs have been tested with serial mice.
+	Fixed a missed regrab of the mouse after the configurator is closed.
+	Pid file is only used if user is using the /dev/gpmwheel FIFO. (Method #2)
+	Killing pids according to pidfile now checks to make sure the process is
+		truely an imwheel process, and only kills it if it is an imwheel process.
+		It also will only kill if using the /dev/gpmwheel FIFO.
+	Imwheel funtions correctly on multiple displays by using the -display
+		option or setting the DISPLAY environment variable (use export/setenv!)
+	Thanks to Arnd Bergmann <arnd@uni.de> we now have gpm support for the
+		Knopex Wineasy 4D mouse.  And due to his patches and them prompting me to
+		update lotsa code we have support for intellimouse serial, as well as
+		support for sideways actions.  This is only available through the FIFO.
+		You must use Method#2 (a variant of which that is) that uses the wheel
+		FIFO as set up by gpm.  XWindows cannot handle the 7 buttons correctly,
+		it can only handle 5, which means only up and down will work with
+		Method #1!
+	Added FreeBSD support, see the FREEBSD file for more.  It requires no
+		changes to compile and install.
+	Added threshhold option for stick users of method #2 (it requires gpm)
+		Use the -t or --threshhold option to set a threshhold from 0-7.
+		The default is 2, it works well.
+	Added no-middle-button option (-n) to gpm.  Use this if you have trouble
+		with unintentional middle button clicks while wheeling/sticking, and you
+		would rather use Emulate3Buttons chording in X (XFree86 at least...)
+	Added conditional compile for gpm-imwheel directory.
+	Added a full manpage.
+
 0.9.5
-    Finished off configure dialog to spec, it's just a helper, not an editor!
-    Updated gpm to version 1.16.0, now sticking with stable versions.
-    - hopefully I'll get a patch and send it to the gpm team for some
-      integration, thus releasing me from this task...
-        - the gpm library is still untested in the console...should work though!
-          see note in version 0.8 below.
-    Added suid option to "make install" for users other than root to be able
-      to run with a pid file.  The default action is yes if nothing is entered
-      at the prompt.  I felt that 'yes' had to be the default action to avoid a
-      bunch of newbie email.  This doesn't allow users to install imwheel as
-      root, and it's not a security risk.  this is for sys-admins, or at least
-      root users to be able to get all their users using the pid file for the 
-      daemon and also for them to be able to kill off old daemons started by
-      other users before.
-    Added -p option for no pidfile stuff, be careful though, this allows any
-      user to start imwheel regardless of a previous imwheel process!
-    Added -D for debug output anytime (no recompiling for those bug reports!)
-      - use the -d option to avoid backgrounding the process!
-    Fixed silly free(NULL) crap...(heh, betchyall loved that one!)
-    added rxvt stuff to imwheelrc file.
-    added EMACS file (an email from an avid wheeler! oh, and it's about emacs!)
---------------------------------------------------------------------------------
+	Finished off configure dialog to spec, it's just a helper, not an editor!
+	Updated gpm to version 1.16.0, now sticking with stable versions.
+	- hopefully I'll get a patch and send it to the gpm team for some
+		integration, thus releasing me from this task...
+	- the gpm library is still untested in the console...should work though!
+		see note in version 0.8 below.
+	Added suid option to "make install" for users other than root to be able
+		to run with a pid file.  The default action is yes if nothing is entered
+		at the prompt.  I felt that 'yes' had to be the default action to avoid a
+		bunch of newbie email.  This doesn't allow users to install imwheel as
+		root, and it's not a security risk.  this is for sys-admins, or at least
+		root users to be able to get all their users using the pid file for the 
+		daemon and also for them to be able to kill off old daemons started by
+		other users before.
+	Added -p option for no pidfile stuff, be careful though, this allows any
+		user to start imwheel regardless of a previous imwheel process!
+	Added -D for debug output anytime (no recompiling for those bug reports!)
+		- use the -d option to avoid backgrounding the process!
+	Fixed silly free(NULL) crap...(heh, betchyall loved that one!)
+	added rxvt stuff to imwheelrc file.
+	added EMACS file (an email from an avid wheeler! oh, and it's about emacs!)
+
 0.9:
-    Configuration helper almost done. (still need to sample wheel actions!)
-    - use up,down,up in the root window to activate!
-    - all functions in window are fully functional.
-    - restart does restart imwheel and thus reread the rc files
-    - grab windows by clicking the snapshot and then on the desired window
-    - more to come!
-    More options and abilities:
-        - daemon mode
-            -d to NOT detach and daemonize!
-        - kill any existing imwheel
-            -k to kill any existing imwheel as a restart
-        - quit after rc files
-            -q, used best with -k to kill any imwheel process and quit
-    More configuration options:
-        - added 2 separately configurable delays
-          fixes netscape dropping keys! (it must queue only one key...)
-          first delay is the delay between repetitions (keyup->keydown)
-          second delay is the delay between pressing and releasing
-                                                       (keydown->keyup)
-          see the new imwheelrc for the netscape values that work for me!
---------------------------------------------------------------------------------
+	Configuration helper almost done. (still need to sample wheel actions!)
+	- use up,down,up in the root window to activate!
+	- all functions in window are fully functional.
+	- restart does restart imwheel and thus reread the rc files
+	- grab windows by clicking the snapshot and then on the desired window
+	- more to come!
+	More options and abilities:
+		- daemon mode
+			-d to NOT detach and daemonize!
+		- kill any existing imwheel
+			-k to kill any existing imwheel as a restart
+		- quit after rc files
+			-q, used best with -k to kill any imwheel process and quit
+	More configuration options:
+		- added 2 separately configurable delays
+		fixes netscape dropping keys! (it must queue only one key...)
+		first delay is the delay between repetitions (keyup->keydown)
+		second delay is the delay between pressing and releasing
+		(keydown->keyup)
+	see the new imwheelrc for the netscape values that work for me!
+
 0.8:
-    Modified gpm 1.15 beta2 for wheel support.  I dunno about the gpm user
-       library and wheel stuff, but it may work with GPM_B_UP and GPM_B_DOWN.
-       use the -W (and -w for non-IM mice) for use with "imwheel --wheel-fifo"
-    IMWheel interfaces with /dev/gpmwheel, use the "--wheel-fifo" option, or
-       "-W /dev/gpmwheel", the -- option has /dev/gpmwheel as the default.
-       Don't forget to reconfigure your mouse pointer in XConfig...
---------------------------------------------------------------------------------
+	Modified gpm 1.15 beta2 for wheel support.  I dunno about the gpm user
+		library and wheel stuff, but it may work with GPM_B_UP and GPM_B_DOWN.
+		use the -W (and -w for non-IM mice) for use with "imwheel --wheel-fifo"
+	IMWheel interfaces with /dev/gpmwheel, use the "--wheel-fifo" option, or
+	"-W /dev/gpmwheel", the -- option has /dev/gpmwheel as the default.
+	Don't forget to reconfigure your mouse pointer in XConfig...
+
 0.7:
-    No segfaults!  Thank God!  New functionality!
-    New Command structure started, and Exclude command added.
-    - Exclude ungrabs mouse for selected windows.
-    More commands may now be added as needed!
-    XV's window grabber was dying because it needed to grab all buttons...
-    - use the line "@Exclude" in an "xv grab" window section. See imwheelrc
---------------------------------------------------------------------------------
+	No segfaults!  Thank God!  New functionality!
+	New Command structure started, and Exclude command added.
+	- Exclude ungrabs mouse for selected windows.
+	More commands may now be added as needed!
+	XV's window grabber was dying because it needed to grab all buttons...
+	- use the line "@Exclude" in an "xv grab" window section. See imwheelrc
+
 0.6:
-    Argh...another bugfix for segfaults...now you don't need an rc file.
---------------------------------------------------------------------------------
+	Argh...another bugfix for segfaults...now you don't need an rc file.
+
 0.5:
-    Argh...a bugfix for segfaults...this time it doesn't care about windows that
-       don't have either title, resource, or class names set (leaving them NULL)
-    Thanks for all the positive response and encouragement.
-    Multi-rep scrolling actions can cause less then you expected to happen.
-    - Be patient, it works most of the time.  There is no way I can find to fix
-      this, so help may be needed!  You will find XSync in use, but I believe
-      that has a minimal effectiveness...makes it work better than before though
-    Moving out of windows and losing focus may cause weird things to happen!
-    - Press and release all modifier keys (alt,ctrl,shift,etc.) to reset input.
---------------------------------------------------------------------------------
+	Argh...a bugfix for segfaults...this time it doesn't care about windows that
+	don't have either title, resource, or class names set (leaving them NULL)
+	Thanks for all the positive response and encouragement.
+	Multi-rep scrolling actions can cause less then you expected to happen.
+	- Be patient, it works most of the time.  There is no way I can find to fix
+		this, so help may be needed!  You will find XSync in use, but I believe
+		that has a minimal effectiveness...makes it work better than before though
+	Moving out of windows and losing focus may cause weird things to happen!
+	- Press and release all modifier keys (alt,ctrl,shift,etc.) to reset input.
+
 0.4:
-    finally! Config file support is added, completing the keyboard config setup.
-    /etc/imwheelrc and/or $HOME/.imwheelrc files are used for configuration.
-    built-ins are still available for unconfigured windows.
-    anybody want to make a client to make configuration a breeze?  Contact me!
-    all clients that have keyboard input can be used with configuration!
-    no new options.
-    more code moving, now two files, whopee you say!  but it made development
-       easier!
-    got reports that KDE compatabilty has been achieved by v0.3
---------------------------------------------------------------------------------
+	finally! Config file support is added, completing the keyboard config setup.
+	/etc/imwheelrc and/or $HOME/.imwheelrc files are used for configuration.
+	built-ins are still available for unconfigured windows.
+	anybody want to make a client to make configuration a breeze?  Contact me!
+	all clients that have keyboard input can be used with configuration!
+	no new options.
+	more code moving, now two files, whopee you say!  but it made development
+		easier!
+	got reports that KDE compatabilty has been achieved by v0.3
+
 0.3:
-    added options engine.
-    added -f or --flip-buttons option to flip behavior, useful for 4 button mice
-    changed engine, now using XTest extension instead of XSendEvent crap.
-    - still grabbing buttons which may be part of the incompatibility with KDE.
-    added other mice that should work as well, according to XFree86 docs.
-    added a grab reset sequence, but it seems to be a nop...
-    - run imwheel again if it dies and leaves your server going funky...
-    cleaned out junk from old engine, new code is cleaner...I think so anyways!
-    XTest extension now required (not checked in code...I may do that)
-    More clients work than ever!
-    Reps for sideways motion (alt-wheel actions) now work in netscape...
-    - only when there are sideways scrollbars
-    - May work everywhere, i dunno!
-    - It works in all tested clients that use cursor left/right keys for actions
---------------------------------------------------------------------------------
+	added options engine.
+	added -f or --flip-buttons option to flip behavior, useful for 4 button mice
+	changed engine, now using XTest extension instead of XSendEvent crap.
+	- still grabbing buttons which may be part of the incompatibility with KDE.
+	added other mice that should work as well, according to XFree86 docs.
+	added a grab reset sequence, but it seems to be a nop...
+	- run imwheel again if it dies and leaves your server going funky...
+	cleaned out junk from old engine, new code is cleaner...I think so anyways!
+	XTest extension now required (not checked in code...I may do that)
+	More clients work than ever!
+	Reps for sideways motion (alt-wheel actions) now work in netscape...
+	- only when there are sideways scrollbars
+	- May work everywhere, i dunno!
+	- It works in all tested clients that use cursor left/right keys for actions
+
 0.2:
-    cleaned up exit on bad display opening.
-    changed library directory to X11R6 instead of X11
-    received confirmation of compatability with Logitech MouseMan+ from:
-        "Markus Martensson" <mortis@acc.umu.se>
-    modifier combinations of Shift,Control, and Alt(Meta) changes behavior.
-    repetition of keystrokes
-    still no setup files...
-    still no change in clients...
---------------------------------------------------------------------------------
+	cleaned up exit on bad display opening.
+	changed library directory to X11R6 instead of X11
+	received confirmation of compatability with Logitech MouseMan+ from:
+		"Markus Martensson" <mortis@acc.umu.se>
+	modifier combinations of Shift,Control, and Alt(Meta) changes behavior.
+	repetition of keystrokes
+	still no setup files...
+	still no change in clients...
+
 0.1:
-    first release
-    streamlined version, unused code is compiled out.
-    no setup, hardcoded page up and page down!
-    no exclusion for specific windows either.
+	first release
+	streamlined version, unused code is compiled out.
+	no setup, hardcoded page up and page down!
+	no exclusion for specific windows either.