mirror of https://gitee.com/openkylin/imwheel.git
format patches
This commit is contained in:
parent
9f75cd59ed
commit
1cbd2908f9
File diff suppressed because it is too large
Load Diff
|
@ -1,9 +1,17 @@
|
|||
Description: Update the upstream changelog
|
||||
Add missing information to the upstream changelog that ships with imwheel -
|
||||
namely, the changes in the most recent releases, as described on the imwheel
|
||||
homepage. Also standardize the formatting for readability.
|
||||
Author: Christopher Martin <chrsmrtn@debian.org>
|
||||
From: Christopher Martin <chrsmrtn@debian.org>
|
||||
Date: Sat, 14 May 2022 03:32:58 +0800
|
||||
Subject: Update the upstream changelog
|
||||
|
||||
Add missing information to the upstream changelog that ships with imwheel -
|
||||
namely, the changes in the most recent releases, as described on the imwheel
|
||||
homepage. Also standardize the formatting for readability.
|
||||
Last-Update: 2010-02-20
|
||||
---
|
||||
ChangeLog | 836 ++++++++++++++++++++++++++++++++++----------------------------
|
||||
1 file changed, 457 insertions(+), 379 deletions(-)
|
||||
|
||||
diff --git a/ChangeLog b/ChangeLog
|
||||
index a63e64f..31c2feb 100644
|
||||
--- a/ChangeLog
|
||||
+++ b/ChangeLog
|
||||
@@ -1,398 +1,476 @@
|
||||
|
|
|
@ -1,7 +1,15 @@
|
|||
Description: Update the default button mappings to reflect changes in
|
||||
how X numbers mouse buttons, and just generally clean up a bit.
|
||||
Author: Christopher Martin <chrsmrtn@debian.org>
|
||||
From: Christopher Martin <chrsmrtn@debian.org>
|
||||
Date: Sat, 14 May 2022 03:32:58 +0800
|
||||
Subject: Update the default button mappings to reflect changes in
|
||||
|
||||
how X numbers mouse buttons, and just generally clean up a bit.
|
||||
Last-Update: 2010-02-20
|
||||
---
|
||||
imwheelrc | 76 ---------------------------------------------------------------
|
||||
1 file changed, 76 deletions(-)
|
||||
|
||||
diff --git a/imwheelrc b/imwheelrc
|
||||
index f02eba2..8925f52 100644
|
||||
--- a/imwheelrc
|
||||
+++ b/imwheelrc
|
||||
@@ -17,7 +17,6 @@
|
||||
|
@ -38,7 +46,7 @@ Last-Update: 2010-02-20
|
|||
#Thanks to Mathias Weyland <mathias@weyland-wtal.de>
|
||||
"^mutt.*"
|
||||
None, Up, Up
|
||||
@@ -108,8 +88,6 @@
|
||||
@@ -108,8 +88,6 @@ Shift_L, Up, Control_L|Y
|
||||
Shift_L, Down, Control_L|E
|
||||
#None, Up, Page_Up
|
||||
#None, Down, Page_Down
|
||||
|
@ -47,7 +55,7 @@ Last-Update: 2010-02-20
|
|||
, Left, Shift_L|Left
|
||||
, Right, Shift_L|Right
|
||||
, Thumb1, Shift_L|Left
|
||||
@@ -128,8 +106,6 @@
|
||||
@@ -128,8 +106,6 @@ Alt_L, Down, Down
|
||||
#Alt_L, Down, Shift_L|Page_Down
|
||||
|
||||
#"^GnomeTerminal"
|
||||
|
@ -56,7 +64,7 @@ Last-Update: 2010-02-20
|
|||
#None, Up, Shift_L|Page_Up
|
||||
#None, Down, Shift_L|Page_Down
|
||||
|
||||
@@ -150,11 +126,8 @@
|
||||
@@ -150,11 +126,8 @@ Alt_L, Right, Control_L|E
|
||||
|
||||
"^VMware"
|
||||
@Exclude
|
||||
|
@ -68,7 +76,7 @@ Last-Update: 2010-02-20
|
|||
#, Left, Alt_L|Left
|
||||
#, Right, Alt_L|Right
|
||||
#
|
||||
@@ -187,14 +160,11 @@
|
||||
@@ -187,14 +160,11 @@ Shift_L, Thumb2, Down, 7,
|
||||
, Thumb2, R
|
||||
|
||||
"^SDL_App"
|
||||
|
@ -83,7 +91,7 @@ Last-Update: 2010-02-20
|
|||
None, Down, Down, 4, 100, 100
|
||||
None, Up, Up, 4, 100, 100
|
||||
None, Thumb1, Right
|
||||
@@ -203,8 +173,6 @@
|
||||
@@ -203,8 +173,6 @@ None, Thumb2, Left
|
||||
"^Netscape.*"
|
||||
, Thumb1, Alt_L|KP_Left
|
||||
, Thumb2, Alt_L|KP_Right
|
||||
|
@ -92,7 +100,7 @@ Last-Update: 2010-02-20
|
|||
|
||||
"^Netscape"
|
||||
#
|
||||
@@ -250,25 +218,11 @@
|
||||
@@ -250,25 +218,11 @@ None, Up, Control_L|Meta_L|Shift_L|parenleft
|
||||
, Down, j
|
||||
, Up, k
|
||||
|
||||
|
@ -118,7 +126,7 @@ Last-Update: 2010-02-20
|
|||
"^xv grab"
|
||||
@Priority=1
|
||||
@Exclude
|
||||
@@ -278,46 +232,19 @@
|
||||
@@ -278,46 +232,19 @@ None, Down, Tab
|
||||
None, Up, Delete
|
||||
|
||||
"^Untitled"
|
||||
|
@ -165,7 +173,7 @@ Last-Update: 2010-02-20
|
|||
# send event to the window manager when in the root window...
|
||||
"\(root\)"
|
||||
, Up, Control_L|N
|
||||
@@ -334,7 +261,6 @@
|
||||
@@ -334,7 +261,6 @@ None, Up, Delete
|
||||
#".*"
|
||||
#@Priority=-1000
|
||||
#@Exclude
|
||||
|
@ -173,7 +181,7 @@ Last-Update: 2010-02-20
|
|||
|
||||
#
|
||||
# These are the defaults, but note that the defaults for the right side of the
|
||||
@@ -346,8 +272,6 @@
|
||||
@@ -346,8 +272,6 @@ None, Up, Delete
|
||||
#
|
||||
#".*"
|
||||
#@Priority=-1001
|
||||
|
|
|
@ -1,7 +1,15 @@
|
|||
Description: Remove makefile function which attempted to install files
|
||||
directly (not compatible with packaging).
|
||||
Author: Christopher Martin <chrsmrtn@debian.org>
|
||||
From: Christopher Martin <chrsmrtn@debian.org>
|
||||
Date: Sat, 14 May 2022 03:32:58 +0800
|
||||
Subject: Remove makefile function which attempted to install files
|
||||
|
||||
directly (not compatible with packaging).
|
||||
Last-Update: 2010-02-20
|
||||
---
|
||||
Makefile.am | 15 +--------------
|
||||
1 file changed, 1 insertion(+), 14 deletions(-)
|
||||
|
||||
diff --git a/Makefile.am b/Makefile.am
|
||||
index 9f93d75..dd93f62 100644
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -1,4 +1,4 @@
|
||||
|
@ -10,7 +18,7 @@ Last-Update: 2010-02-20
|
|||
|
||||
bin_PROGRAMS=imwheel
|
||||
|
||||
@@ -22,19 +22,6 @@
|
||||
@@ -22,19 +22,6 @@ dist-hook:
|
||||
find $(distdir) -name CVS -exec rm -rvf '{}' ';' ; \
|
||||
done
|
||||
|
||||
|
|
|
@ -1,9 +1,17 @@
|
|||
Description: Revamp the imwheel manpage, eliminating references to aspects
|
||||
of imwheel that are no longer relevant on modern systems, or to options
|
||||
that have been disabled. Also update the imwheel command descriptions to
|
||||
reflect patches, including the "more than 9 buttons" change.
|
||||
Author: Christopher Martin <chrsmrtn@debian.org>
|
||||
From: Christopher Martin <chrsmrtn@debian.org>
|
||||
Date: Sat, 14 May 2022 03:32:58 +0800
|
||||
Subject: Revamp the imwheel manpage, eliminating references to aspects
|
||||
|
||||
of imwheel that are no longer relevant on modern systems, or to options
|
||||
that have been disabled. Also update the imwheel command descriptions to
|
||||
reflect patches, including the "more than 9 buttons" change.
|
||||
Last-Update: 2010-02-20
|
||||
---
|
||||
imwheel.1 | 447 ++++++++++++--------------------------------------------------
|
||||
1 file changed, 85 insertions(+), 362 deletions(-)
|
||||
|
||||
diff --git a/imwheel.1 b/imwheel.1
|
||||
index 32d1d9c..a355d45 100644
|
||||
--- a/imwheel.1
|
||||
+++ b/imwheel.1
|
||||
@@ -1,17 +1,15 @@
|
||||
|
@ -30,7 +38,7 @@ Last-Update: 2010-02-20
|
|||
server.
|
||||
.LP
|
||||
.SH "COMMAND LINE OPTIONS"
|
||||
@@ -20,47 +18,53 @@
|
||||
@@ -20,47 +18,53 @@ Available command line options are as follows:
|
||||
\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!
|
||||
|
@ -103,7 +111,7 @@ Last-Update: 2010-02-20
|
|||
.br
|
||||
See also xmodmap(1).
|
||||
.RE
|
||||
@@ -76,159 +80,49 @@
|
||||
@@ -76,159 +80,49 @@ suggest using the \fB-d\fP option to prevent imwheel from detaching from the
|
||||
controlling terminal.
|
||||
.TP
|
||||
\fB-d, --detach\fP
|
||||
|
@ -229,7 +237,8 @@ Last-Update: 2010-02-20
|
|||
-"Pointer"(XFree86 3.3) or
|
||||
-"InputDevice"(XFree86 4.x)
|
||||
-section:
|
||||
-.LP
|
||||
+allowed, and may cause strange things to happen while using the wheel or buttons.
|
||||
.LP
|
||||
-1 axis (vertical wheel):
|
||||
-.RS
|
||||
-.nf
|
||||
|
@ -264,8 +273,7 @@ Last-Update: 2010-02-20
|
|||
-.LP
|
||||
-The Buttons option may be greater than stated above if you have thumb
|
||||
-buttons, or other extras that qualify as buttons.
|
||||
+allowed, and may cause strange things to happen while using the wheel or buttons.
|
||||
.LP
|
||||
-.LP
|
||||
-Make sure your Protocol is set to either "IMPS/2" for a PS/2 mouse
|
||||
-or for serial mice set it to "IntelliMouse" or "Auto".
|
||||
-This is for IntelliMouse compatible mice, other protocols may be required for other mice.
|
||||
|
@ -278,7 +286,7 @@ Last-Update: 2010-02-20
|
|||
.LP
|
||||
.B NOTE
|
||||
.br
|
||||
@@ -239,105 +133,19 @@
|
||||
@@ -239,105 +133,19 @@ mouse and/or mouse button grabs and that don't specify specific buttons to
|
||||
grab. These clients fail when they try to grab the mouse because the buttons 4
|
||||
and 5 are already grabbed by imwheel. XV is an example of a client that
|
||||
requires these types of grabs to succeed. KDE clients use the ZAxis for their
|
||||
|
@ -390,7 +398,7 @@ Last-Update: 2010-02-20
|
|||
come first served, so more generic matches should always occur later in the
|
||||
configuration file.
|
||||
.LP
|
||||
@@ -353,18 +161,18 @@
|
||||
@@ -353,18 +161,18 @@ Window Resource Name
|
||||
(null) which matches "\\(null\\)" in the imwheelrc
|
||||
.fi
|
||||
.LP
|
||||
|
@ -412,7 +420,7 @@ Last-Update: 2010-02-20
|
|||
realize that the keys used should not be keys that may conflict with other
|
||||
key actions in the game or application you are aiming to make work!
|
||||
The included imwheelrc file has a "(null)" section included to demonstrate, and
|
||||
@@ -374,15 +182,16 @@
|
||||
@@ -374,15 +182,16 @@ Each window/class/resource name \fImust\fP be enclosed in double quotes (") on a
|
||||
itself.
|
||||
.LP
|
||||
Inside each window section is any number of translation definitions or commands.
|
||||
|
@ -434,7 +442,7 @@ Last-Update: 2010-02-20
|
|||
.LP
|
||||
.B REQUIRED
|
||||
.br
|
||||
@@ -402,7 +211,7 @@
|
||||
@@ -402,7 +211,7 @@ in use during the wheel action. If the field is blank then \fIany\fP modifier
|
||||
will match, so put these last in their window section.
|
||||
.TP
|
||||
\fIMouse Action Input\fP
|
||||
|
@ -443,7 +451,7 @@ Last-Update: 2010-02-20
|
|||
\fIonly\fP one:
|
||||
|
||||
.nf
|
||||
@@ -448,36 +257,10 @@
|
||||
@@ -448,36 +257,10 @@ Default is 0.
|
||||
Commands start with the `@' character. Commands are as follows:
|
||||
.TP
|
||||
\fB@Exclude\fP
|
||||
|
@ -481,7 +489,7 @@ Last-Update: 2010-02-20
|
|||
.TP
|
||||
\fB@Priority\fP=\fIpriority\fP
|
||||
Using this is allowed in each window/class/resource section.
|
||||
@@ -486,30 +269,30 @@
|
||||
@@ -486,30 +269,30 @@ Equal priorities on sections make the imwheelrc file parsed from top to bottom
|
||||
to find the first match.
|
||||
Thus \fB@Priority\fP can be used to make the file search for matches out of order,
|
||||
then you dont have to keep the entries in order if you so please.
|
||||
|
@ -518,7 +526,7 @@ Last-Update: 2010-02-20
|
|||
the user in the first place but adding the \fB-R\fP option to indicate to
|
||||
itself that this is a restarted imwheel. The \fB-R\fP is not for use by the
|
||||
user, as it bypasses some configuration of imwheel.
|
||||
@@ -529,41 +312,6 @@
|
||||
@@ -529,41 +312,6 @@ other! And not one after the other, they are both pressed at the same time
|
||||
essentially.
|
||||
.RE
|
||||
.LP
|
||||
|
@ -560,7 +568,7 @@ Last-Update: 2010-02-20
|
|||
Common Modifier Keysym names used in X:
|
||||
.nf
|
||||
Shift_L Shift_R
|
||||
@@ -579,7 +327,8 @@
|
||||
@@ -579,7 +327,8 @@ Super_L Super_R
|
||||
Hyper_L Hyper_R
|
||||
.fi
|
||||
.LP
|
||||
|
@ -570,7 +578,7 @@ Last-Update: 2010-02-20
|
|||
Use the \fIxev\fP program to test your own keys on your keyboard!
|
||||
.LP
|
||||
.nf
|
||||
@@ -605,19 +354,18 @@
|
||||
@@ -605,19 +354,18 @@ The path to this file may differ for you.
|
||||
Remember, there's always the configurator.
|
||||
And \fBxev\fP will also help here too!
|
||||
.LP
|
||||
|
@ -594,7 +602,7 @@ Last-Update: 2010-02-20
|
|||
left handed and imwheel use.
|
||||
.LP
|
||||
.RS
|
||||
@@ -632,79 +380,54 @@
|
||||
@@ -632,79 +380,54 @@ NOTE: most of these are NOT going to work, because of all the limits in X.
|
||||
.fi
|
||||
.RE
|
||||
.LP
|
||||
|
|
|
@ -1,9 +1,17 @@
|
|||
Description: Eliminate an unnecessary dependency.
|
||||
Author: Christopher Martin <chrsmrtn@debian.org>
|
||||
From: Christopher Martin <chrsmrtn@debian.org>
|
||||
Date: Sat, 14 May 2022 03:32:58 +0800
|
||||
Subject: Eliminate an unnecessary dependency.
|
||||
|
||||
Last-Update: 2010-02-20
|
||||
---
|
||||
configure.in | 2 --
|
||||
1 file changed, 2 deletions(-)
|
||||
|
||||
diff --git a/configure.in b/configure.in
|
||||
index b41560f..84a203a 100644
|
||||
--- a/configure.in
|
||||
+++ b/configure.in
|
||||
@@ -321,8 +321,6 @@
|
||||
@@ -321,8 +321,6 @@ LIBS=
|
||||
AC_CHECK_LIB(X11, XCreateWindow,, [
|
||||
AC_MSG_ERROR([IMWheel depends on the X11 libraries!])
|
||||
], $LIBS_saved $X_LIBS)
|
||||
|
|
|
@ -1,11 +1,22 @@
|
|||
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>
|
||||
From: "Thomas Liebetraut thomas@tommie-lie.de and Christopher Martin"
|
||||
<chrsmrtn@debian.org>
|
||||
Date: Sat, 14 May 2022 03:32:58 +0800
|
||||
Subject: 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.
|
||||
Last-Update: 2010-02-20
|
||||
---
|
||||
imwheel.c | 30 +++++++-------
|
||||
util.c | 137 +++++++++++++++++++++++++++++++++++++++++++++-----------------
|
||||
util.h | 10 +++--
|
||||
3 files changed, 120 insertions(+), 57 deletions(-)
|
||||
|
||||
diff --git a/imwheel.c b/imwheel.c
|
||||
index 2232914..def185c 100644
|
||||
--- a/imwheel.c
|
||||
+++ b/imwheel.c
|
||||
@@ -59,22 +59,18 @@
|
||||
@@ -59,22 +59,18 @@ const struct option options[]=
|
||||
//{"restart", 0, 0, 'R'}, //not used by users!
|
||||
{"root-window", 0, 0, 'r'},
|
||||
{"quit", 0, 0, 'q'},
|
||||
|
@ -31,7 +42,7 @@ Last-Update: 2010-02-20
|
|||
{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 @@
|
||||
@@ -84,11 +80,7 @@ const char *optionusage[][2]=
|
||||
//{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
|
||||
|
@ -43,7 +54,7 @@ Last-Update: 2010-02-20
|
|||
{NULL, NULL}
|
||||
};
|
||||
int buttonFlip=False, useFifo=False, detach=True, quit=False,
|
||||
@@ -108,6 +100,7 @@
|
||||
@@ -108,6 +100,7 @@ int main(int argc, char **argv)
|
||||
|
||||
getOptions(argc,argv,opts,options);
|
||||
setupstatebits();
|
||||
|
@ -51,7 +62,7 @@ Last-Update: 2010-02-20
|
|||
if(!displayName)
|
||||
displayName=XDisplayName(NULL);
|
||||
Printf("display=%s\n",displayName);
|
||||
@@ -137,7 +130,7 @@
|
||||
@@ -137,7 +130,7 @@ void grabButtons(Display *d, Window w)
|
||||
return;
|
||||
Printf("Grab buttons!\n");
|
||||
grabbed=True;
|
||||
|
@ -60,7 +71,7 @@ Last-Update: 2010-02-20
|
|||
{
|
||||
if(buttons[i])
|
||||
{
|
||||
@@ -168,7 +161,7 @@
|
||||
@@ -168,7 +161,7 @@ void ungrabButtons(Display *d, Window w)
|
||||
Printf("Ungrab buttons!\n");
|
||||
XSync(d,False);
|
||||
grabbed=False;
|
||||
|
@ -69,7 +80,7 @@ Last-Update: 2010-02-20
|
|||
{
|
||||
if(buttons[i])
|
||||
{
|
||||
@@ -331,7 +324,7 @@
|
||||
@@ -331,7 +324,7 @@ signed char getInput(Display *d, XEvent *e, XModifierKeymap **xmk, signed char k
|
||||
{
|
||||
//e->xbutton.button^=buttonFlip;
|
||||
button= buttonIndex(e->xbutton.button);
|
||||
|
@ -78,7 +89,7 @@ Last-Update: 2010-02-20
|
|||
e->xbutton.button= button= button+4;
|
||||
XQueryKeymap(d,km);
|
||||
if(debug)
|
||||
@@ -635,9 +628,9 @@
|
||||
@@ -635,9 +628,9 @@ void eventLoop(Display *d, char **argv)
|
||||
int k;
|
||||
|
||||
j=button-4;
|
||||
|
@ -90,7 +101,7 @@ Last-Update: 2010-02-20
|
|||
break;
|
||||
}
|
||||
k=statebits[makeModMask(xmk,km)&STATE_MASK];
|
||||
@@ -647,6 +640,11 @@
|
||||
@@ -647,6 +640,11 @@ void eventLoop(Display *d, char **argv)
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -102,47 +113,8 @@ Last-Update: 2010-02-20
|
|||
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 @@
|
||||
|
||||
#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**);
|
||||
diff --git a/util.c b/util.c
|
||||
index 6cffd66..37cf49b 100644
|
||||
--- a/util.c
|
||||
+++ b/util.c
|
||||
@@ -9,6 +9,7 @@
|
||||
|
@ -172,7 +144,7 @@ Last-Update: 2010-02-20
|
|||
int statebits[STATE_MASK+1];
|
||||
char *wname=NULL;
|
||||
XClassHint xch={NULL,NULL};
|
||||
@@ -92,7 +87,7 @@
|
||||
@@ -92,7 +87,7 @@ const int reps[1<<NUM_STATES]=
|
||||
20, // ControlMask|Mod1Mask
|
||||
50 //ShiftMask|ControlMask|Mod1Mask
|
||||
};
|
||||
|
@ -181,7 +153,7 @@ Last-Update: 2010-02-20
|
|||
{
|
||||
{
|
||||
"Page_Up", //None
|
||||
@@ -184,6 +179,43 @@
|
||||
@@ -184,6 +179,43 @@ void setupstatebits()
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
|
@ -225,7 +197,7 @@ Last-Update: 2010-02-20
|
|||
RETSIGTYPE exitParent(int num)
|
||||
{
|
||||
exit(0);
|
||||
@@ -196,11 +228,11 @@
|
||||
@@ -196,11 +228,11 @@ int isUsedButton(int b)
|
||||
int i;
|
||||
|
||||
Printf("isUsedButton(%d)=",b);
|
||||
|
@ -240,7 +212,7 @@ Last-Update: 2010-02-20
|
|||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
@@ -209,10 +241,10 @@
|
||||
@@ -209,10 +241,10 @@ int buttonIndex(int b)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -253,7 +225,7 @@ Last-Update: 2010-02-20
|
|||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
@@ -220,6 +252,8 @@
|
||||
@@ -220,6 +252,8 @@ int buttonIndex(int b)
|
||||
void getOptions(int argc, char **argv, char *opts, const struct option *options)
|
||||
{
|
||||
int ch,i,j,killold=False,invalidOpts=False;
|
||||
|
@ -262,7 +234,7 @@ Last-Update: 2010-02-20
|
|||
|
||||
while((ch=getopt_long_only(argc,argv,opts,options,&i))>=0)
|
||||
{
|
||||
@@ -296,6 +330,16 @@
|
||||
@@ -296,6 +330,16 @@ void getOptions(int argc, char **argv, char *opts, const struct option *options)
|
||||
exit(0);
|
||||
break;
|
||||
case 'b':
|
||||
|
@ -279,7 +251,7 @@ Last-Update: 2010-02-20
|
|||
memset(buttons,0,NUM_BUTTONS*sizeof(int));
|
||||
for(j=0;optarg[j] && j<NUM_BUTTONS;j++)
|
||||
{
|
||||
@@ -306,6 +350,7 @@
|
||||
@@ -306,6 +350,7 @@ void getOptions(int argc, char **argv, char *opts, const struct option *options)
|
||||
}
|
||||
buttons[j]=optarg[j]-'0';
|
||||
}
|
||||
|
@ -287,7 +259,7 @@ Last-Update: 2010-02-20
|
|||
break;
|
||||
case 'h':
|
||||
case '?':
|
||||
@@ -317,6 +362,12 @@
|
||||
@@ -317,6 +362,12 @@ void getOptions(int argc, char **argv, char *opts, const struct option *options)
|
||||
}
|
||||
Printf("\n");
|
||||
}
|
||||
|
@ -300,7 +272,7 @@ Last-Update: 2010-02-20
|
|||
if(invalidOpts)
|
||||
exit(1);
|
||||
if(!restart)
|
||||
@@ -525,7 +576,7 @@
|
||||
@@ -525,7 +576,7 @@ void printUsage(char *pname, const struct option options[], const char *usage[][
|
||||
int i,maxa=0,maxb=0,len;
|
||||
char str[80];
|
||||
|
||||
|
@ -309,7 +281,7 @@ Last-Update: 2010-02-20
|
|||
if(!options || !usage)
|
||||
return;
|
||||
printf("%s",pname);
|
||||
@@ -564,12 +615,13 @@
|
||||
@@ -564,12 +615,13 @@ void printUsage(char *pname, const struct option options[], const char *usage[][
|
||||
for(i=0;options[i].name;i++)
|
||||
{
|
||||
*str=0;
|
||||
|
@ -328,7 +300,7 @@ Last-Update: 2010-02-20
|
|||
printf("%-*.*s",maxa,maxa,str);
|
||||
if(usage[i][0])
|
||||
printf(" %-*.*s",maxb,maxb,usage[i][0]);
|
||||
@@ -847,7 +899,8 @@
|
||||
@@ -847,7 +899,8 @@ struct WinAction *getRC()
|
||||
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);
|
||||
|
@ -338,7 +310,7 @@ Last-Update: 2010-02-20
|
|||
//Get Button
|
||||
p=strchr(line,',');
|
||||
if(p)
|
||||
@@ -859,16 +912,16 @@
|
||||
@@ -859,16 +912,16 @@ struct WinAction *getRC()
|
||||
{
|
||||
sscanf(line+6,"%d",&i);
|
||||
Printf("(Button%d)",i);
|
||||
|
@ -359,7 +331,7 @@ Last-Update: 2010-02-20
|
|||
{
|
||||
if(buttons[i])
|
||||
newwa[num_wa-1].button=i+4;//buttons[i];
|
||||
@@ -878,12 +931,12 @@
|
||||
@@ -878,12 +931,12 @@ struct WinAction *getRC()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -377,7 +349,7 @@ Last-Update: 2010-02-20
|
|||
}
|
||||
Printf("\t=%d\n",newwa[num_wa-1].button);
|
||||
if(!newwa[num_wa-1].button)
|
||||
@@ -895,7 +948,8 @@
|
||||
@@ -895,7 +948,8 @@ struct WinAction *getRC()
|
||||
newwa[num_wa].id=NULL;
|
||||
continue;
|
||||
}
|
||||
|
@ -387,7 +359,7 @@ Last-Update: 2010-02-20
|
|||
//Get Keysym Out
|
||||
p=strchr(line,',');
|
||||
if(p)
|
||||
@@ -908,7 +962,10 @@
|
||||
@@ -908,7 +962,10 @@ struct WinAction *getRC()
|
||||
else
|
||||
exitString("Unrecognized or missing Keysym Outs (arg 3) in config.\n%s\n",line);
|
||||
if(p)
|
||||
|
@ -399,7 +371,7 @@ Last-Update: 2010-02-20
|
|||
else
|
||||
continue;
|
||||
//Get Reps
|
||||
@@ -921,7 +978,10 @@
|
||||
@@ -921,7 +978,10 @@ struct WinAction *getRC()
|
||||
newwa[num_wa-1].reps=strtol(line,NULL,10);
|
||||
}
|
||||
if(p)
|
||||
|
@ -411,7 +383,7 @@ Last-Update: 2010-02-20
|
|||
else
|
||||
continue;
|
||||
//Get Delay
|
||||
@@ -934,7 +994,10 @@
|
||||
@@ -934,7 +994,10 @@ struct WinAction *getRC()
|
||||
newwa[num_wa-1].delay=strtol(line,NULL,10);
|
||||
}
|
||||
if(p)
|
||||
|
@ -423,7 +395,7 @@ Last-Update: 2010-02-20
|
|||
else
|
||||
continue;
|
||||
//Get Delay Up
|
||||
@@ -1079,7 +1142,7 @@
|
||||
@@ -1079,7 +1142,7 @@ void writeRC(struct WinAction *wa)
|
||||
perror("imwheel,writeRC");
|
||||
return;
|
||||
}
|
||||
|
@ -432,7 +404,7 @@ Last-Update: 2010-02-20
|
|||
for(cur=NULL,p=wa;p->id;p=&p[1])
|
||||
{
|
||||
if(!cur || strcmp(cur->id,p->id))
|
||||
@@ -1091,7 +1154,7 @@
|
||||
@@ -1091,7 +1154,7 @@ void writeRC(struct WinAction *wa)
|
||||
{
|
||||
for(i=0; p->in[i]; i++)
|
||||
fprintf(f,"%s%s",(i?"|":""),p->in[i]);
|
||||
|
@ -441,3 +413,46 @@ Last-Update: 2010-02-20
|
|||
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)
|
||||
diff --git a/util.h b/util.h
|
||||
index 24788b8..e326152 100644
|
||||
--- a/util.h
|
||||
+++ b/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 @@ struct WinAction
|
||||
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 @@ void printKeymap(Display *d, char[32]);
|
||||
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**);
|
||||
|
|
Loading…
Reference in New Issue