Skip to content

Commit 0c569e0

Browse files
committed
rename --aftermodifiers to --afterkeys and make it look at all keys
1 parent b4db1bf commit 0c569e0

File tree

10 files changed

+92
-96
lines changed

10 files changed

+92
-96
lines changed

cmd_click.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ int cmd_click(context_t *context) {
66
char *cmd = context->argv[0];
77
int ret = 0;
88
int clear_modifiers = 0;
9-
int after_modifiers = 0;
9+
int after_keys = 0;
1010
charcodemap_t *active_mods = NULL;
1111
int active_mods_n;
1212
char *window_arg = NULL;
@@ -15,12 +15,12 @@ int cmd_click(context_t *context) {
1515

1616
int c;
1717
enum {
18-
opt_unused, opt_help, opt_clearmodifiers, opt_aftermodifiers, opt_window, opt_delay,
18+
opt_unused, opt_help, opt_clearmodifiers, opt_afterkeys, opt_window, opt_delay,
1919
opt_repeat
2020
};
2121
static struct option longopts[] = {
2222
{ "clearmodifiers", no_argument, NULL, opt_clearmodifiers },
23-
{ "aftermodifiers", no_argument, NULL, opt_aftermodifiers },
23+
{ "afterkeys", no_argument, NULL, opt_afterkeys },
2424
{ "help", no_argument, NULL, opt_help },
2525
{ "window", required_argument, NULL, opt_window },
2626
{ "delay", required_argument, NULL, opt_delay },
@@ -30,7 +30,7 @@ int cmd_click(context_t *context) {
3030
static const char *usage =
3131
"Usage: %s [options] <button>\n"
3232
"--clearmodifiers - reset active modifiers (alt, etc) while moving\n"
33-
"--aftermodifiers - wait for modifiers to be released before typing\n"
33+
"--afterkeys - wait for all keys to be released before typing\n"
3434
"--window WINDOW - specify a window to send click to\n"
3535
"--repeat REPEATS - number of times to click. Default is 1\n"
3636
"--delay MILLISECONDS - delay in milliseconds between clicks.\n"
@@ -55,8 +55,8 @@ int cmd_click(context_t *context) {
5555
clear_modifiers = 1;
5656
break;
5757
case 'a':
58-
case opt_aftermodifiers:
59-
after_modifiers = 1;
58+
case opt_afterkeys:
59+
after_keys = 1;
6060
break;
6161
case 'w':
6262
case opt_window:
@@ -93,8 +93,8 @@ int cmd_click(context_t *context) {
9393
button = atoi(context->argv[0]);
9494

9595
window_each(context, window_arg, {
96-
if (after_modifiers) {
97-
xdo_wait_for_modifier_release(context->xdo);
96+
if (after_keys) {
97+
xdo_wait_for_key_release(context->xdo);
9898
}
9999
if (clear_modifiers) {
100100
xdo_get_active_modifiers(context->xdo, &active_mods, &active_mods_n);

cmd_key.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ int cmd_key(context_t *context) {
2222

2323
/* Options */
2424
int clear_modifiers = 0;
25-
int after_modifiers = 0;
25+
int after_keys = 0;
2626

2727
static struct option longopts[] = {
2828
{ "clearmodifiers", no_argument, NULL, 'c' },
29-
{ "aftermodifiers", no_argument, NULL, 'a' },
29+
{ "afterkeys", no_argument, NULL, 'a' },
3030
{ "delay", required_argument, NULL, 'd' },
3131
{ "repeat-delay", required_argument, NULL, 'R' },
3232
{ "help", no_argument, NULL, 'h' },
@@ -38,7 +38,7 @@ int cmd_key(context_t *context) {
3838
static const char *usage =
3939
"Usage: %s [options] <keysequence> [keysequence ...]\n"
4040
"--clearmodifiers - clear active keyboard modifiers during keystrokes\n"
41-
"--aftermodifiers - wait for modifiers to be released before typing\n"
41+
"--afterkeys - wait for all keys to be released before typing\n"
4242
"--delay DELAY - Use DELAY milliseconds between keystrokes\n"
4343
"--repeat TIMES - How many times to repeat the key sequence\n"
4444
"--repeat-delay DELAY - DELAY milliseconds between repetitions\n"
@@ -65,7 +65,7 @@ int cmd_key(context_t *context) {
6565
clear_modifiers = 1;
6666
break;
6767
case 'a':
68-
after_modifiers = 1;
68+
after_keys = 1;
6969
break;
7070
case 'h':
7171
printf(usage, cmd);
@@ -121,8 +121,8 @@ int cmd_key(context_t *context) {
121121

122122
int max_arg = context->argc;
123123
window_each(context, window_arg, {
124-
if (after_modifiers) {
125-
xdo_wait_for_modifier_release(context->xdo);
124+
if (after_keys) {
125+
xdo_wait_for_key_release(context->xdo);
126126
}
127127
if (clear_modifiers) {
128128
xdo_get_active_modifiers(context->xdo, &active_mods, &active_mods_n);

cmd_mousedown.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ int cmd_mousedown(context_t *context) {
88
charcodemap_t *active_mods = NULL;
99
int active_mods_n;
1010
int clear_modifiers = 0;
11-
int after_modifiers = 0;
11+
int after_keys = 0;
1212
char *window_arg = NULL;
1313

1414
int c;
1515
static struct option longopts[] = {
1616
{ "clearmodifiers", no_argument, NULL, 'c' },
17-
{ "aftermodifiers", no_argument, NULL, 'a' },
17+
{ "afterkeys", no_argument, NULL, 'a' },
1818
{ "help", no_argument, NULL, 'h' },
1919
{ "window", required_argument, NULL, 'w' },
2020
{ 0, 0, 0, 0 },
@@ -23,7 +23,7 @@ int cmd_mousedown(context_t *context) {
2323
"Usage: %s [--clearmodifiers] [--window WINDOW] <button>\n"
2424
"--window <windowid> - specify a window to send keys to\n"
2525
"--clearmodifiers - reset active modifiers (alt, etc) while clicking\n"
26-
"--aftermodifiers - wait for modifiers to be released before clicking\n";
26+
"--afterkeys - wait for all keys to be released before clicking\n";
2727

2828
int option_index;
2929

@@ -34,7 +34,7 @@ int cmd_mousedown(context_t *context) {
3434
clear_modifiers = 1;
3535
break;
3636
case 'a':
37-
after_modifiers = 1;
37+
after_keys = 1;
3838
break;
3939
case 'h':
4040
printf(usage, cmd);
@@ -61,8 +61,8 @@ int cmd_mousedown(context_t *context) {
6161
button = atoi(context->argv[0]);
6262

6363
window_each(context, window_arg, {
64-
if (after_modifiers) {
65-
xdo_wait_for_modifier_release(context->xdo);
64+
if (after_keys) {
65+
xdo_wait_for_key_release(context->xdo);
6666
}
6767
if (clear_modifiers) {
6868
xdo_get_active_modifiers(context->xdo, &active_mods, &active_mods_n);

cmd_mousemove.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
struct mousemove {
66
Window window;
77
int clear_modifiers;
8-
int after_modifiers;
8+
int after_keys;
99
int opsync;
1010
int polar_coordinates;
1111
int x;
@@ -33,12 +33,12 @@ int cmd_mousemove(context_t *context) {
3333

3434
int c;
3535
enum {
36-
opt_unused, opt_help, opt_sync, opt_clearmodifiers, opt_aftermodifiers, opt_polar,
36+
opt_unused, opt_help, opt_sync, opt_clearmodifiers, opt_afterkeys, opt_polar,
3737
opt_screen, opt_step, opt_delay, opt_window
3838
};
3939
static struct option longopts[] = {
4040
{ "clearmodifiers", no_argument, NULL, opt_clearmodifiers },
41-
{ "aftermodifiers", no_argument, NULL, opt_aftermodifiers },
41+
{ "afterkeys", no_argument, NULL, opt_afterkeys },
4242
{ "help", no_argument, NULL, opt_help},
4343
{ "polar", no_argument, NULL, opt_polar },
4444
{ "screen", required_argument, NULL, opt_screen },
@@ -51,7 +51,7 @@ int cmd_mousemove(context_t *context) {
5151
static const char *usage =
5252
"Usage: %s [options] <x> <y>\n"
5353
"-c, --clearmodifiers - reset active modifiers (alt, etc) while moving\n"
54-
"-a, --aftermodifiers - wait for modifiers to be released before moving\n"
54+
"-a, --afterkeys - wait for all keys to be released before moving\n"
5555

5656
//"-d, --delay <MS> - sleeptime in milliseconds between steps.\n"
5757
//"--step <STEP> - pixels to move each time along path to x,y.\n" "-p, --polar - Use polar coordinates. X as an angle, Y as distance\n"
@@ -68,8 +68,8 @@ int cmd_mousemove(context_t *context) {
6868
mousemove.clear_modifiers = 1;
6969
break;
7070
case 'a':
71-
case opt_aftermodifiers:
72-
mousemove.after_modifiers = 1;
71+
case opt_afterkeys:
72+
mousemove.after_keys = 1;
7373
break;
7474
case 'h':
7575
case opt_help:
@@ -195,8 +195,8 @@ static int _mousemove(context_t *context, struct mousemove *mousemove) {
195195
int mx, my, mscreen;
196196
xdo_get_mouse_location(context->xdo, &mx, &my, &mscreen);
197197

198-
if (mousemove->after_modifiers) {
199-
xdo_wait_for_modifier_release(context->xdo);
198+
if (mousemove->after_keys) {
199+
xdo_wait_for_key_release(context->xdo);
200200
}
201201

202202
if (mousemove->clear_modifiers) {

cmd_mousemove_relative.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,28 @@ int cmd_mousemove_relative(context_t *context) {
77
char *cmd = *context->argv;
88
int polar_coordinates = 0;
99
int clear_modifiers = 0;
10-
int after_modifiers = 0;
10+
int after_keys = 0;
1111
int opsync = 0;
1212
int origin_x = -1, origin_y = -1;
1313

1414
charcodemap_t *active_mods = NULL;
1515
int active_mods_n;
1616
int c;
1717
enum {
18-
opt_unused, opt_help, opt_sync, opt_clearmodifiers, opt_aftermodifiers, opt_polar
18+
opt_unused, opt_help, opt_sync, opt_clearmodifiers, opt_afterkeys, opt_polar
1919
};
2020
static struct option longopts[] = {
2121
{ "help", no_argument, NULL, opt_help },
2222
{ "sync", no_argument, NULL, opt_sync },
2323
{ "polar", no_argument, NULL, opt_polar },
2424
{ "clearmodifiers", no_argument, NULL, opt_clearmodifiers },
25-
{ "aftermodifiers", no_argument, NULL, opt_aftermodifiers },
25+
{ "afterkeys", no_argument, NULL, opt_afterkeys },
2626
{ 0, 0, 0, 0 },
2727
};
2828
static const char *usage =
2929
"Usage: %s [options] <x> <y>\n"
3030
"-c, --clearmodifiers - reset active modifiers (alt, etc) while moving\n"
31-
"-a, --aftermodifiers - wait for modifiers to be released before moving\n"
31+
"-a, --afterkeys - wait for all keys to be released before moving\n"
3232
"-p, --polar - Use polar coordinates. X as an angle, Y as distance\n"
3333
"--sync - only exit once the mouse has moved\n"
3434
"\n"
@@ -63,7 +63,7 @@ int cmd_mousemove_relative(context_t *context) {
6363
clear_modifiers = 1;
6464
break;
6565
case 'a':
66-
case opt_aftermodifiers:
66+
case opt_afterkeys:
6767
clear_modifiers = 1;
6868
break;
6969
default:
@@ -102,8 +102,8 @@ int cmd_mousemove_relative(context_t *context) {
102102
y = (-sin(radians) * distance);
103103
}
104104

105-
if (after_modifiers) {
106-
xdo_wait_for_modifier_release(context->xdo);
105+
if (after_keys) {
106+
xdo_wait_for_key_release(context->xdo);
107107
}
108108
if (clear_modifiers) {
109109
xdo_get_active_modifiers(context->xdo, &active_mods, &active_mods_n);

cmd_mouseup.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ int cmd_mouseup(context_t *context) {
99
charcodemap_t *active_mods = NULL;
1010
int active_mods_n;
1111
int clear_modifiers = 0;
12-
int after_modifiers = 0;
12+
int after_keys = 0;
1313

1414
int c;
1515
static struct option longopts[] = {
1616
{ "clearmodifiers", no_argument, NULL, 'c' },
17-
{ "aftermodifiers", no_argument, NULL, 'a' },
17+
{ "afterkeys", no_argument, NULL, 'a' },
1818
{ "help", no_argument, NULL, 'h' },
1919
{ "window", required_argument, NULL, 'w' },
2020
{ 0, 0, 0, 0 },
@@ -23,7 +23,7 @@ int cmd_mouseup(context_t *context) {
2323
"Usage: %s [--clearmodifiers] [--window WINDOW] <button>\n"
2424
"--window <windowid> - specify a window to send keys to\n"
2525
"--clearmodifiers - reset active modifiers (alt, etc) while clicking\n"
26-
"--aftermodifiers - wait for modifiers to be released before clicking\n";
26+
"--afterkeys - wait for all keys to be released before clicking\n";
2727
int option_index;
2828

2929
while ((c = getopt_long_only(context->argc, context->argv, "+caw:h",
@@ -38,7 +38,7 @@ int cmd_mouseup(context_t *context) {
3838
clear_modifiers = 1;
3939
break;
4040
case 'a':
41-
after_modifiers = 1;
41+
after_keys = 1;
4242
break;
4343
case 'w':
4444
window_arg = strdup(optarg);
@@ -60,8 +60,8 @@ int cmd_mouseup(context_t *context) {
6060
button = atoi(context->argv[0]);
6161

6262
window_each(context, window_arg, {
63-
if (after_modifiers) {
64-
xdo_wait_for_modifier_release(context->xdo);
63+
if (after_keys) {
64+
xdo_wait_for_key_release(context->xdo);
6565
}
6666
if (clear_modifiers) {
6767
xdo_get_active_modifiers(context->xdo, &active_mods, &active_mods_n);

cmd_type.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,17 @@ int cmd_type(context_t *context) {
2626

2727
/* Options */
2828
int clear_modifiers = 0;
29-
int after_modifiers = 0;
29+
int after_keys = 0;
3030
useconds_t delay = 12000; /* 12ms between keystrokes default */
3131

3232
enum {
33-
opt_unused, opt_clearmodifiers, opt_aftermodifiers, opt_delay, opt_help,
33+
opt_unused, opt_clearmodifiers, opt_afterkeys, opt_delay, opt_help,
3434
opt_window, opt_args, opt_terminator, opt_file
3535
};
3636

3737
struct option longopts[] = {
3838
{ "clearmodifiers", no_argument, NULL, opt_clearmodifiers },
39-
{ "aftermodifiers", no_argument, NULL, opt_aftermodifiers },
39+
{ "afterkeys", no_argument, NULL, opt_afterkeys },
4040
{ "delay", required_argument, NULL, opt_delay },
4141
{ "help", no_argument, NULL, opt_help },
4242
{ "window", required_argument, NULL, opt_window },
@@ -52,7 +52,7 @@ int cmd_type(context_t *context) {
5252
"--window <windowid> - specify a window to send keys to\n"
5353
"--delay <milliseconds> - delay between keystrokes\n"
5454
"--clearmodifiers - reset active modifiers (alt, etc) while typing\n"
55-
"--aftermodifiers - wait for modifiers to be released before typing\n"
55+
"--afterkeys - wait for all keys to be released before typing\n"
5656
"--args N - how many arguments to expect in the exec command. This is\n"
5757
" useful for ending an exec and continuing with more xdotool\n"
5858
" commands\n"
@@ -79,8 +79,8 @@ int cmd_type(context_t *context) {
7979
case opt_clearmodifiers:
8080
clear_modifiers = 1;
8181
break;
82-
case opt_aftermodifiers:
83-
after_modifiers = 1;
82+
case opt_afterkeys:
83+
after_keys = 1;
8484
break;
8585
case opt_help:
8686
printf(usage, cmd);
@@ -186,8 +186,8 @@ int cmd_type(context_t *context) {
186186
}
187187

188188
window_each(context, window_arg, {
189-
if (after_modifiers) {
190-
xdo_wait_for_modifier_release(context->xdo);
189+
if (after_keys) {
190+
xdo_wait_for_key_release(context->xdo);
191191
}
192192
if (clear_modifiers) {
193193
xdo_get_active_modifiers(context->xdo, &active_mods, &active_mods_n);

0 commit comments

Comments
 (0)