summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Bernd Steinhauser <berniyh@exherbo.org> 2014-01-31 23:46:51 +0100
committerAvatar Bernd Steinhauser <berniyh@exherbo.org> 2014-02-01 00:09:45 +0100
commit297d421e2b83e48be96cd051205492410f26a73e (patch)
tree136056f4f96af2843aee8854e5014e3ba1bfc2bc
parent2a5fe4ea0b265c348be61c67252df87356386f90 (diff)
downloadberniyh-297d421e2b83e48be96cd051205492410f26a73e.tar.gz
berniyh-297d421e2b83e48be96cd051205492410f26a73e.tar.xz
Add improved patch, which works a bit better.
-rw-r--r--packages/x11-apps/imwheel/files/support-more-buttons.patch801
-rw-r--r--packages/x11-apps/imwheel/imwheel-1.0.0_pre12-r2.exheres-0 (renamed from packages/x11-apps/imwheel/imwheel-1.0.0_pre12-r1.exheres-0)0
2 files changed, 398 insertions, 403 deletions
diff --git a/packages/x11-apps/imwheel/files/support-more-buttons.patch b/packages/x11-apps/imwheel/files/support-more-buttons.patch
index 2df12bf..5a4c662 100644
--- a/packages/x11-apps/imwheel/files/support-more-buttons.patch
+++ b/packages/x11-apps/imwheel/files/support-more-buttons.patch
@@ -1,447 +1,442 @@
Source: Debian
Upstream: No, development stalled
-Reasons: Support more mouse buttons, see description below
+Reasons: Support more mouse buttons
-Description: Several code changes here: 1) eliminate irrelevant or deprecated
- imwheel options; 2) add support for more than 9 buttons; and 3) grab a few
- upstream changes that were never released.
-Author: Thomas Liebetraut <thomas@tommie-lie.de> and Christopher Martin <chrsmrtn@debian.org>
-Last-Update: 2010-02-20
---- a/imwheel.c
-+++ b/imwheel.c
-@@ -59,22 +59,18 @@
- //{"restart", 0, 0, 'R'}, //not used by users!
- {"root-window", 0, 0, 'r'},
- {"quit", 0, 0, 'q'},
-- {"sensitivity", 1, 0, 's'},
-- {"threshhold", 1, 0, 't'},
- {"version", 0, 0, 'v'},
-- {"wheel-fifo", 2, 0, 'W'},
-- {"transpose", 0, 0, 'x'},
- {0, 0, 0, 0}
+
+diff -Naurp imwheel-1.0.0pre12/cfg.c imwheel-1.0.0pre13/cfg.c
+--- imwheel-1.0.0pre12/cfg.c 2004-07-15 01:06:22.000000000 -0700
++++ imwheel-1.0.0pre13/cfg.c 2006-02-20 18:39:30.000000000 -0800
+@@ -438,7 +438,13 @@ int GrabWheel(Jax *jax,Hotspot *hs)
+ "Wheel: Left (Button6)",
+ "Wheel: Right (Button7)",
+ "Button: Thumb1 (Button8)",
+- "Button: Thumb2 (Button9)"
++ "Button: Thumb2 (Button9)",
++ "Button: Task (Button10)",
++ "Button: Tilt Up (Button11)",
++ "Button: Tilt Down (Button12)",
++ "Button: Tilt Left (Button13)",
++ "Button: Tilt Right (Button14)"
++
+ };
+
+ if(!useFifo)
+diff -Naurp imwheel-1.0.0pre12/ChangeLog imwheel-1.0.0pre13/ChangeLog
+--- imwheel-1.0.0pre12/ChangeLog 2004-06-09 18:41:49.000000000 -0700
++++ imwheel-1.0.0pre13/ChangeLog 2006-02-20 17:19:47.000000000 -0800
+@@ -1,3 +1,8 @@
++1.0.0.pre12a:
++ ported button-spec change from Mandriva v0.9.9
++ increased number of buttons recognized from 9 to 16
++ Added Task, TiltUp, TiltDown, TiltLeft, TiltRight buttons
++
+ 1.0.0.pre4:
+ "\(root\)" works for non-wheel-fifos, as long as @Exclude isn't used.
+ instead use :
+diff -Naurp imwheel-1.0.0pre12/imwheel.1 imwheel-1.0.0pre13/imwheel.1
+--- imwheel-1.0.0pre12/imwheel.1 2004-06-09 18:41:49.000000000 -0700
++++ imwheel-1.0.0pre13/imwheel.1 2006-02-20 17:37:02.000000000 -0800
+@@ -27,7 +27,7 @@ See also xmodmap(1).
+ 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 may specify any of up to eleven buttons.
+ the \fIbutton-spec\fP is decoded in the following order for wheel input:
+ .RS
+ .RS
+@@ -46,21 +46,31 @@ Index Interpreted As Button Number
+ 5 Thumb Button 1 8
+ .br
+ 6 Thumb Button 2 9
++.br
++7 Task Button 10
++.br
++8 Button Up 11
++.br
++9 Button Down 12
++.br
++10 Button Left 13
++.br
++11 Button Right 14
+
+ .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 10 11 12 13 14".
+ .br
+ See also xmodmap(1).
+ .RE
+@@ -329,7 +339,7 @@ sum = 0
+ .fi
+ .RE
+ .SH "IMWHEELRC"
+-IMWheel uses, optionally, two configuration files. One called /etc/X11/imwheel/imwheelrc,
++IMWheel uses, optionally, two configuration files. One called /etc/X11/imwheelrc,
+ which is used for everybody. The other is $HOME/.imwheelrc, used only for one
+ user. One is supplied and should have been installed automatically in /etc/X11/imwheel/
+ if not also in the installing users $HOME as well. All whitespace is ignored
+@@ -410,7 +420,13 @@ Up
+ Down
+ Left
+ Right
+-Thumb
++Thumb1
++Thumb2
++Task
++TiltUp
++TiltDown
++TiltLeft
++TiltRight
+ .fi
+
+ These are self explanatory. If you have trouble use the configurator!
+@@ -469,12 +485,17 @@ Motions are mapped as follows:
+ .RS
+ .nf
+
+-Up is button 4
+-Down is button 5
+-Left is button 6
+-Right is button 7
+-Thumb1 is button 8
+-Thumb2 is button 9
++Up is button 4
++Down is button 5
++Left is button 6
++Right is button 7
++Thumb1 is button 8
++Thumb2 is button 9
++Task is button 10
++TiltUp is button 11
++TiltDown is button 12
++TiltLeft is button 13
++TiltRight is button 14
+ .fi
+ .RE
+ .RE
+@@ -561,6 +582,11 @@ Button6 Left Mouse Wheel Left
+ Button7 Right Mouse Wheel Right
+ Button8 Thumb1 Side Mouse Button 1 (left/up)
+ Button9 Thumb2 Side Mouse Button 2 (right/down)
++Button10 Task Task Switch Button
++Button11 TiltUp Mouse Wheel Tilt Up
++Button11 TiltDown Mouse Wheel Tilt Down
++Button13 TiltLeft Mouse Wheel Tilt Left
++Button14 TiltRight Mouse Wheel Tilt Right
+ .ni
+ .RE
+ .LP
+@@ -671,7 +697,7 @@ Jonathan Atkins <jcatki@jonatkins.org>
+ $HOME/.imwheelrc
+ The users configuration file.
+
+-/etc/X11/imwheel/imwheelrc
++/etc/X11/imwheelrc
+ The global location for the configuration
+ file, it is always loaded. Overided by
+ the users configuration file.
+diff -Naurp imwheel-1.0.0pre12/imwheel.1.html imwheel-1.0.0pre13/imwheel.1.html
+--- imwheel-1.0.0pre12/imwheel.1.html 2004-06-09 18:41:49.000000000 -0700
++++ imwheel-1.0.0pre13/imwheel.1.html 2006-02-20 02:10:07.000000000 -0800
+@@ -41,7 +41,7 @@ See also <A HREF="http://jcatki.dhs.org/
+ Remap buttons in <I>button-spec</I> to interpreted wheel/thumb input.
+ Also limits the button grab to the specified buttons when using the ZAxis method.
+ (see &quot;X WINDOWS ZAXIS METHOD&quot; below)
+-the <I>button-spec</I> may specify any of up to five buttons.
++the <I>button-spec</I> may specify any of up to eleven buttons.
+ the <I>button-spec</I> is decoded in the following order for wheel input:
+ <DL COMPACT><DT><DD>
+ <DL COMPACT><DT><DD>
+@@ -60,15 +60,25 @@ Index Interpreted As Button Number
+ 5 Thumb Button 1 8
+ <BR>
+ 6 Thumb Button 2 9
++<BR>
++7 Task Button 10
++<BR>
++8 Button Up 11
++<BR>
++9 Button Down 12
++<BR>
++10 Button Left 13
++<BR>
++11 Button Right 14
+
+ </PRE>
+
+ </DL>
+
+-A <I>button-spec</I> of &quot;45&quot; will limit the grabbed buttons for only wheel up and down.
++A <I>button-spec</I> of &quot;4 5&quot; will limit the grabbed buttons for only wheel up and down.
+ <BR>
+
+-A <I>button-spec</I> of &quot;67&quot; may be useful to use actual buttons 6 and 7 as wheel up
++A <I>button-spec</I> of &quot;6 7&quot; 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>
+
+@@ -76,11 +86,11 @@ A <I>button-spec</I> of &quot;0&quot; tu
+ the <I>button-spec</I> for something that doesn't exist on your mouse.
+ <BR>
+
+-A <I>button-spec</I> of &quot;45006&quot; may be for normal wheel up/down and a thumb button 1, but
++A <I>button-spec</I> of &quot;4 5 0 0 6&quot; may be for normal wheel up/down and a thumb button 1, but
+ no horizontal wheel axis.
+ <BR>
+
+-The default <I>button-spec</I> is &quot;456789&quot;.
++The default <I>button-spec</I> is &quot;4 5 6 7 8 9 10 11 12 13 14&quot;.
+ <BR>
+
+ See also <A HREF="http://jcatki.dhs.org/cgi-bin/man2html.cgi?1+xmodmap">xmodmap</A>(1).
+@@ -662,6 +672,9 @@ Button6 Left Mouse Wheel Left
+ Button7 Right Mouse Wheel Right
+ Button8 Thumb1 Side Mouse Button 1 (left/up)
+ Button9 Thumb2 Side Mouse Button 2 (right/down)
++Button10 Task Task Switch Button
++Button11 TiltLefteft Mouse Wheel Tilt Left
++Button11 TiltRightight Mouse Wheel Tilt Right
+ </DL>
+
+ Common Modifier Keysym names used in X:
+diff -Naurp imwheel-1.0.0pre12/imwheel.c imwheel-1.0.0pre13/imwheel.c
+--- imwheel-1.0.0pre12/imwheel.c 2004-08-29 03:22:03.000000000 -0700
++++ imwheel-1.0.0pre13/imwheel.c 2006-02-20 02:10:08.000000000 -0800
+@@ -68,27 +68,27 @@ const struct option options[]=
};
const char *optionusage[][2]=
{ /*{argument name, usage}*/
- {"delay-rate", "auto repeat until button release (default=250)"}, //a
+- {"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 (default=\"4 5 6 7 8 9\", 0=skip)"},//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
+- {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
- {"display-name", "Sets X display to use (one per FIFO if FIFO used)"}, //X
- {NULL, "Swaps buttons 4 and 5 events (same as -b 54"}, //4
-+ {"display-name", "Sets X display to use"}, //X
-+ {NULL, "Swaps buttons 4 and 5 events (same as -b \"5 4\")"}, //4
- {NULL, "Use event subwindow instead of XGetInputFocus"}, //f
- {NULL, "Disable the use of Focus Events for button grabs"}, //g
- {NULL, "For this help! Now you know"}, //h
-@@ -84,11 +80,7 @@
- //{NULL, "RESERVED: used when imwheel reloads itself"}, //R
- {NULL, "Allow wheeling in the root window (no cfg dialog)"}, //r
- {NULL, "Don't start imwheel process, after args"}, //q
+- {NULL, "Use event subwindow instead of XGetInputFocus"}, //f
+- {NULL, "Disable the use of Focus Events for button grabs"}, //g
+- {NULL, "For this help! Now you know"}, //h
+- {NULL, "Use the old key style default actions"}, //K
+- {NULL, "Kills the running imwheel process"}, //k
+- {NULL, "IMWheel doesn't use or check any pid files"}, //p
+- //{NULL, "RESERVED: used when imwheel reloads itself"}, //R
+- {NULL, "Allow wheeling in the root window (no cfg dialog)"}, //r
+- {NULL, "Don't start imwheel process, after args"}, //q
- {"sum-min", "Stick devices require this much total movment (w/fifo)"}, //s
- {"stick-min", "Stick devices require this much pressure (w/fifo)"}, //t
- {NULL, "Show version info and exit"}, //v
+- {NULL, "Show version info and exit"}, //v
- {"fifo-path", "Use a GPM fifo instead of XGrabButton"}, //W
- {NULL, "swap X and Y stick axis (w/fifo)"}, //x
++ {"delay-rate", "auto repeat until button release (default=250)"}, //a
++ {"grab-buttons", "Specify up to 6 remappings 0=none (default=4 5 6 7 8 9 10 11 12)"}, //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
++ {"display-name", "Sets X display to use (one per FIFO if FIFO used)"}, //X
++ {NULL, "Swaps buttons 4 and 5 events (same as -b 54"}, //4
++ {NULL, "Use event subwindow instead of XGetInputFocus"}, //f
++ {NULL, "Disable the use of Focus Events for button grabs"}, //g
++ {NULL, "For this help! Now you know"}, //h
++ {NULL, "Use the old key style default actions"}, //K
++ {NULL, "Kills the running imwheel process"}, //k
++ {NULL, "IMWheel doesn't use or check any pid files"}, //p
++ //{NULL, "RESERVED: used when imwheel reloads itself"}, //R
++ {NULL, "Allow wheeling in the root window (no cfg dialog)"}, //r
++ {NULL, "Don't start imwheel process, after args"}, //q
++ {"sum-min", "Stick devices require this much total movment (w/fifo)"}, //s
++ {"stick-min", "Stick devices require this much pressure (w/fifo)"}, //t
++ {NULL, "Show version info and exit"}, //v
++ {"fifo-path", "Use a GPM fifo instead of XGrabButton"}, //W
++ {NULL, "swap X and Y stick axis (w/fifo)"}, //x
{NULL, NULL}
};
int buttonFlip=False, useFifo=False, detach=True, quit=False,
-@@ -108,6 +100,7 @@
+diff -Naurp imwheel-1.0.0pre12/imwheelrc imwheel-1.0.0pre13/imwheelrc
+--- imwheel-1.0.0pre12/imwheelrc 2004-06-09 18:41:49.000000000 -0700
++++ imwheel-1.0.0pre13/imwheelrc 2006-02-20 02:10:11.000000000 -0800
+@@ -1,4 +1,4 @@
+-# IMWheel Configuration file ($HOME/.imwheelrc or /etc/imwheelrc)
++# IMWheel Configuration file ($HOME/.imwheelrc or /etc/X11/imwheelrc)
+ # (GPL)Jon Atkins <jcatki@jonatkins.org>
+ # Please read the README and/or imwheel(1) manpage for info
+ # and this is best operated on using vim (as I said: It's crunchy)
+@@ -44,6 +44,19 @@
+ #, Button7, Button7
+ #, Button6, Button6
+ #, Button7, Button7
++# here we just assign the buttons to themselves (List their names)
++#".*"
++#, Up, Button4
++#, Down, Button5
++#, Left, Button6
++#, Right, Button7
++#, Thumb1, Button8
++#, Thumb2, Button9
++#, Task, Button10
++#, TiltUp, Button11
++#, TiltDown, Button12
++#, TiltLeft, Button13
++#, TiltRight, Button14
- getOptions(argc,argv,opts,options);
- setupstatebits();
-+ setupbuttonnames();
- if(!displayName)
- displayName=XDisplayName(NULL);
- Printf("display=%s\n",displayName);
-@@ -137,7 +130,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 +161,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 +324,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 +628,9 @@
- int k;
+ #Thanks to Mathias Weyland <mathias@weyland-wtal.de>
+ "^mutt.*"
+@@ -152,6 +165,34 @@ Alt_L, Right, Control_L|E
+ @Exclude
+ #@Repeat
- 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 +640,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);
---- a/util.h
-+++ b/util.h
-@@ -10,7 +10,7 @@
++"^Mozilla-firefox-bin$"
++#, Up, Button4
++#, Down, Button5
++#, Left, Alt_L|Left
++#, Right, Alt_L|Right
++#
++# If you want to scroll by a few lines then uncomment these 4 lines
++# and comment out the paging 4 lines below these!
++#
++Shift_L, Down, Page_Down, 1#, 1000, 1000
++Shift_L, Up, Page_Up, 1#, 1000, 1000
++#None, Down, Down, 7#, 1000, 1000
++#None, Up, Up, 7#, 1000, 1000
++#
++# If you don't like page scrolling then comment these out and uncomment above!
++#
++#Shift_L, Down, Down, 7,
++#Shift_L, Up, Up, 7,
++#None, Down, Page_Down, 1,
++#None, Up, Page_Up, 1,
++# Left/Right & Thumb stuff
++None, Left, Left, 7,
++None, Right, Right, 7,
++None, Thumb1, Down, 7,
++Shift_L, Thumb1, Up, 7,
++None, Thumb2, Up, 7,
++Shift_L, Thumb2, Down, 7,
++
+ "^Mozilla-bin$"
+ #, Up, Button4
+ #, Down, Button5
+diff -Naurp imwheel-1.0.0pre12/README imwheel-1.0.0pre13/README
+--- imwheel-1.0.0pre12/README 2004-06-09 18:41:49.000000000 -0700
++++ imwheel-1.0.0pre13/README 2006-02-20 02:10:26.000000000 -0800
+@@ -45,7 +45,9 @@ wheel actions. To do this:
- #define PIDFILE PIDDIR"/imwheel.pid"
+ [ METHOD #1 : XGrabButton ]
--#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
- };
+-1) edit /etc/XF86Config with your favorite editor (I suggest vim! It's crunchy)
++1) edit /etc/X11/XF86Config with your favorite editor (I suggest vim! It's
++ crunchy)
++
+ a. add the following line to the "Pointer" section.
--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;
+ for 1 wheel:
+@@ -122,8 +124,8 @@ nor any other mice for that fact...unles
+ yourself or send me a mouse so that I can implement it in gpm. To add a new
+ mouse to this method no change to imwheel is required.
- 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**);
---- a/util.c
-+++ b/util.c
-@@ -9,6 +9,7 @@
- #include <stdarg.h>
- #include <string.h>
- #include <signal.h>
-+#include <ctype.h>
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <regex.h>
-@@ -51,15 +52,9 @@
+-1) Edit /etc/XF86Config with your favorite editor (I suggest vim! It's crunchy)
+- OR use XF86Setup. That's easier!
++1) Edit /etc/X11/XF86Config with your favorite editor (I suggest vim! It's
++ crunchy) OR use XF86Setup. That's easier!
+
+ b. Make sure your Protocol is set to "MouseSystems"
+ Mouse support is dependent on gpm. Right now I KNOW imps2 works!
+diff -Naurp imwheel-1.0.0pre12/util.c imwheel-1.0.0pre13/util.c
+--- imwheel-1.0.0pre12/util.c 2004-08-29 03:21:46.000000000 -0700
++++ imwheel-1.0.0pre13/util.c 2006-02-20 02:10:35.000000000 -0800
+@@ -51,14 +51,19 @@
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",
++int buttons[NUM_BUTTONS+1]={4,5,6,7,8,9,10,11,12,0};
+ const char *button_names[]={
+ "Up",
+ "Down",
+ "Left",
+ "Right",
+ "Thumb1",
- "Thumb2"
--};
-+int *buttons = NULL;
-+int buttons_cnt = 0;
-+char *(*button_names)[] = NULL;
++ "Thumb2",
++ "Task",
++ "TiltUp",
++ "TiltDown",
++ "TiltLeft",
++ "TiltRight",
+ };
int statebits[STATE_MASK+1];
char *wname=NULL;
- XClassHint xch={NULL,NULL};
-@@ -92,7 +87,7 @@
- 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
-@@ -184,6 +179,43 @@
-
- /*----------------------------------------------------------------------------*/
-
-+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);
-@@ -196,11 +228,11 @@
- 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;
- }
+@@ -219,7 +224,7 @@ int buttonIndex(int b)
- /*----------------------------------------------------------------------------*/
-@@ -209,10 +241,10 @@
- {
- 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);
- }
-
- /*----------------------------------------------------------------------------*/
-@@ -220,6 +252,8 @@
void getOptions(int argc, char **argv, char *opts, const struct option *options)
{
- int ch,i,j,killold=False,invalidOpts=False;
-+ char *ButtonOpt = NULL;
-+
+- int ch,i,j,killold=False,invalidOpts=False;
++ int ch,i,j,k,l,killold=False,invalidOpts=False;
while((ch=getopt_long_only(argc,argv,opts,options,&i))>=0)
{
-@@ -296,6 +330,16 @@
- exit(0);
+@@ -297,14 +302,23 @@ void getOptions(int argc, char **argv, c
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++)
+- for(j=0;optarg[j] && j<NUM_BUTTONS;j++)
++ k=0;
++ l=0;
++ for(j=0;optarg[j] && j<NUM_BUTTONS*4;j++)
{
-@@ -306,6 +350,7 @@
+- if(optarg[j]<'0' || optarg[j]>'9')
++
++ if(optarg[j]==' ' || optarg[j+1]=='\0')
+ {
+- fprintf(stderr,"imwheel: ERROR: buttons: #%d: %c is not a number!\n",j,optarg[j]);
+- exit(1);
++ if(optarg[j+1]!='\0') { optarg[j]='\0';}
++ buttons[k]=atoi(optarg+l);
++ if(buttons[k]< 0 || buttons[k]> MAX_BUTTONS)
++ {
++ fprintf(stderr,"imwheel: ERROR: buttons: #%d: %s is a number out of range !\n",k,optarg+l);
++ exit(1);
++ }
++ l+=strlen(optarg+l)+1;
++ k++;
}
- buttons[j]=optarg[j]-'0';
+- buttons[j]=optarg[j]-'0';
}
-+*/
break;
case 'h':
- case '?':
-@@ -317,6 +362,12 @@
- }
- 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)
-@@ -525,7 +576,7 @@
- int i,maxa=0,maxb=0,len;
- char str[80];
+@@ -735,7 +749,7 @@ int file_allowed(char *fname)
-- 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);
-@@ -564,12 +615,13 @@
- for(i=0;options[i].name;i++)
- {
- *str=0;
-- if(options[i].name)
-- sprintf(str,"--%s",options[i].name);
-- if(options[i].val && options[i].name)
-- sprintf(str,"%s|",str);
-+ sprintf(str,"%s%s%s ",
-+ options[i].name?"--":"",
-+ options[i].name?options[i].name:"",
-+ options[i].name&&options[i].val?"|-":
-+ options[i].val?"-":"");
- if(options[i].val)
-- sprintf(str,"%s-%c",str,options[i].val);
-+ str[strlen(str)-1]=options[i].val;
- printf("%-*.*s",maxa,maxa,str);
- if(usage[i][0])
- printf(" %-*.*s",maxb,maxb,usage[i][0]);
-@@ -847,7 +899,8 @@
- exitString("expected 3 args, got 1, in config.\n%s\n",line);
- Printf("Keysym mask: \"%s\"\n",line);
- newwa[num_wa-1].in=getPipeArray(line);
-- memmove(line,p+1,strlen(p+1)+1);
-+ for(p++; isspace(*p); p++);
-+ memmove(line,p,strlen(p)+1);
- //Get Button
- p=strchr(line,',');
- if(p)
-@@ -859,16 +912,16 @@
- {
- 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];
-@@ -878,12 +931,12 @@
- }
- }
- }
-- 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)
-@@ -895,7 +948,8 @@
- newwa[num_wa].id=NULL;
- continue;
- }
-- memmove(line,p+1,strlen(p+1)+1);
-+ for(p++; isspace(*p); p++);
-+ memmove(line,p,strlen(p)+1);
- //Get Keysym Out
- p=strchr(line,',');
- if(p)
-@@ -908,7 +962,10 @@
- else
- exitString("Unrecognized or missing Keysym Outs (arg 3) in config.\n%s\n",line);
- if(p)
-- memmove(line,p+1,strlen(p+1)+1);
-+ {
-+ for(p++; isspace(*p); p++);
-+ memmove(line,p,strlen(p)+1);
-+ }
- else
- continue;
- //Get Reps
-@@ -921,7 +978,10 @@
- newwa[num_wa-1].reps=strtol(line,NULL,10);
- }
- if(p)
-- memmove(line,p+1,strlen(p+1)+1);
-+ {
-+ for(p++; isspace(*p); p++);
-+ memmove(line,p,strlen(p)+1);
-+ }
- else
- continue;
- //Get Delay
-@@ -934,7 +994,10 @@
- newwa[num_wa-1].delay=strtol(line,NULL,10);
- }
- if(p)
-- memmove(line,p+1,strlen(p+1)+1);
-+ {
-+ for(p++; isspace(*p); p++);
-+ memmove(line,p,strlen(p)+1);
-+ }
- else
- continue;
- //Get Delay Up
-@@ -1079,7 +1142,7 @@
- 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))
-@@ -1091,7 +1154,7 @@
- {
- 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)
+ struct WinAction *getRC()
+ {
+- char fname[2][1024]={"","/etc/X11/imwheel/imwheelrc"}, line[1024], *p, *q, winid[1024];
++ char fname[2][1024]={"","/etc/X11/imwheelrc"}, line[1024], *p, *q, winid[1024];
+ int fi,i;
+ struct WinAction *newwa=NULL;
+ FILE *f=NULL;
+diff -Naurp imwheel-1.0.0pre12/util.h imwheel-1.0.0pre13/util.h
+--- imwheel-1.0.0pre12/util.h 2004-06-09 18:41:49.000000000 -0700
++++ imwheel-1.0.0pre13/util.h 2006-02-20 02:10:35.000000000 -0800
+@@ -10,7 +10,8 @@
+
+ #define PIDFILE PIDDIR"/imwheel.pid"
+
+-#define NUM_BUTTONS 6
++#define NUM_BUTTONS 14
++#define MAX_BUTTONS 16
+ #define STATE_MASK (ShiftMask|ControlMask|Mod1Mask|Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask)
+ #define NUM_STATES 3
+ #define MAX_MASKTRANS 8
diff --git a/packages/x11-apps/imwheel/imwheel-1.0.0_pre12-r1.exheres-0 b/packages/x11-apps/imwheel/imwheel-1.0.0_pre12-r2.exheres-0
index e5b9110..e5b9110 100644
--- a/packages/x11-apps/imwheel/imwheel-1.0.0_pre12-r1.exheres-0
+++ b/packages/x11-apps/imwheel/imwheel-1.0.0_pre12-r2.exheres-0