autohotkey's ControlClick,&Set Default not working?
up vote
0
down vote
favorite
I'm following this awesome AutoHotkeyScript and having difficulty getting the Set Default
button to be clicked.
off topic:
If you want to replicate, I had to change a few commands for detection of the Sound window to work, so here's where I currently am:
Run mmsys.cpl
IfWinNotActive, Sound, , WinActivate, Sound,
WinWait,Sound ; Change "Sound" to the name of the window in your local language
ControlSend,SysListView321,{Down 1} ; This number selects the matching audio device in the list, change it accordingly
Sleep, 100
ControlClick, &Set Default; Change "&Set Default" to the name of the button in your local language
Sleep, 100
;ControlClick,OK
now, the AHK log
shows this as executing:
109: {
110: toggle := !toggle
112: if toggle
114: Run,mmsys.cpl
115: IfWinNotActive,Sound,l
115: WinActivate,Sound (0.03)
116: WinWait,Sound (0.31)
119: ControlSend,SysListView321,{Down 1} (0.01)
120: Sleep,100 (0.11)
121: ControlClick,&Set Default; Change "&Set Default" to the name of the button in your local language
122: Sleep,100 (0.11)
124: }
125: if !toggle
138: }
139: Return (6.74)
but &Set Default
isn't being clicked.
I've verified that the button name is, in fact, &Set Default
.
I guess I could use ClassNN's Button2
, but I'd like to know -why- this isn't working, not just hack my way through it.
Alternatively I can send [alt down]S[alt up]
to set it as default, but again, that's hacking, and why isn't the simple ControlClick working?
windows-7 autohotkey
add a comment |
up vote
0
down vote
favorite
I'm following this awesome AutoHotkeyScript and having difficulty getting the Set Default
button to be clicked.
off topic:
If you want to replicate, I had to change a few commands for detection of the Sound window to work, so here's where I currently am:
Run mmsys.cpl
IfWinNotActive, Sound, , WinActivate, Sound,
WinWait,Sound ; Change "Sound" to the name of the window in your local language
ControlSend,SysListView321,{Down 1} ; This number selects the matching audio device in the list, change it accordingly
Sleep, 100
ControlClick, &Set Default; Change "&Set Default" to the name of the button in your local language
Sleep, 100
;ControlClick,OK
now, the AHK log
shows this as executing:
109: {
110: toggle := !toggle
112: if toggle
114: Run,mmsys.cpl
115: IfWinNotActive,Sound,l
115: WinActivate,Sound (0.03)
116: WinWait,Sound (0.31)
119: ControlSend,SysListView321,{Down 1} (0.01)
120: Sleep,100 (0.11)
121: ControlClick,&Set Default; Change "&Set Default" to the name of the button in your local language
122: Sleep,100 (0.11)
124: }
125: if !toggle
138: }
139: Return (6.74)
but &Set Default
isn't being clicked.
I've verified that the button name is, in fact, &Set Default
.
I guess I could use ClassNN's Button2
, but I'd like to know -why- this isn't working, not just hack my way through it.
Alternatively I can send [alt down]S[alt up]
to set it as default, but again, that's hacking, and why isn't the simple ControlClick working?
windows-7 autohotkey
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm following this awesome AutoHotkeyScript and having difficulty getting the Set Default
button to be clicked.
off topic:
If you want to replicate, I had to change a few commands for detection of the Sound window to work, so here's where I currently am:
Run mmsys.cpl
IfWinNotActive, Sound, , WinActivate, Sound,
WinWait,Sound ; Change "Sound" to the name of the window in your local language
ControlSend,SysListView321,{Down 1} ; This number selects the matching audio device in the list, change it accordingly
Sleep, 100
ControlClick, &Set Default; Change "&Set Default" to the name of the button in your local language
Sleep, 100
;ControlClick,OK
now, the AHK log
shows this as executing:
109: {
110: toggle := !toggle
112: if toggle
114: Run,mmsys.cpl
115: IfWinNotActive,Sound,l
115: WinActivate,Sound (0.03)
116: WinWait,Sound (0.31)
119: ControlSend,SysListView321,{Down 1} (0.01)
120: Sleep,100 (0.11)
121: ControlClick,&Set Default; Change "&Set Default" to the name of the button in your local language
122: Sleep,100 (0.11)
124: }
125: if !toggle
138: }
139: Return (6.74)
but &Set Default
isn't being clicked.
I've verified that the button name is, in fact, &Set Default
.
I guess I could use ClassNN's Button2
, but I'd like to know -why- this isn't working, not just hack my way through it.
Alternatively I can send [alt down]S[alt up]
to set it as default, but again, that's hacking, and why isn't the simple ControlClick working?
windows-7 autohotkey
I'm following this awesome AutoHotkeyScript and having difficulty getting the Set Default
button to be clicked.
off topic:
If you want to replicate, I had to change a few commands for detection of the Sound window to work, so here's where I currently am:
Run mmsys.cpl
IfWinNotActive, Sound, , WinActivate, Sound,
WinWait,Sound ; Change "Sound" to the name of the window in your local language
ControlSend,SysListView321,{Down 1} ; This number selects the matching audio device in the list, change it accordingly
Sleep, 100
ControlClick, &Set Default; Change "&Set Default" to the name of the button in your local language
Sleep, 100
;ControlClick,OK
now, the AHK log
shows this as executing:
109: {
110: toggle := !toggle
112: if toggle
114: Run,mmsys.cpl
115: IfWinNotActive,Sound,l
115: WinActivate,Sound (0.03)
116: WinWait,Sound (0.31)
119: ControlSend,SysListView321,{Down 1} (0.01)
120: Sleep,100 (0.11)
121: ControlClick,&Set Default; Change "&Set Default" to the name of the button in your local language
122: Sleep,100 (0.11)
124: }
125: if !toggle
138: }
139: Return (6.74)
but &Set Default
isn't being clicked.
I've verified that the button name is, in fact, &Set Default
.
I guess I could use ClassNN's Button2
, but I'd like to know -why- this isn't working, not just hack my way through it.
Alternatively I can send [alt down]S[alt up]
to set it as default, but again, that's hacking, and why isn't the simple ControlClick working?
windows-7 autohotkey
windows-7 autohotkey
asked Jul 23 '15 at 6:48
paIncrease
1696
1696
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
up vote
0
down vote
doh, looks like it's a simple syntax problem:
- you don't need a semicolon at the end of every line
- you do need a space delimiter between the command and the semicolon.
for example, WinWait, Sound;
is a problem but WinWait, Sound ;
is correct.
add a comment |
up vote
0
down vote
For ControlClick:
I finally found my own solution after skimming the documentation more thoroughly:
https://autohotkey.com/docs/commands/ControlClick.htm#Reliability
You can specify NA as the sixth parameter to wait for the mouse button to lift.
I found that when firing Control, Check, ,Button1
prior to ControlClick
the click didn't work, but adding the NA
to the end somehow magically fixed it. I suppose a click was being simulated and had not yet lifted.
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
doh, looks like it's a simple syntax problem:
- you don't need a semicolon at the end of every line
- you do need a space delimiter between the command and the semicolon.
for example, WinWait, Sound;
is a problem but WinWait, Sound ;
is correct.
add a comment |
up vote
0
down vote
doh, looks like it's a simple syntax problem:
- you don't need a semicolon at the end of every line
- you do need a space delimiter between the command and the semicolon.
for example, WinWait, Sound;
is a problem but WinWait, Sound ;
is correct.
add a comment |
up vote
0
down vote
up vote
0
down vote
doh, looks like it's a simple syntax problem:
- you don't need a semicolon at the end of every line
- you do need a space delimiter between the command and the semicolon.
for example, WinWait, Sound;
is a problem but WinWait, Sound ;
is correct.
doh, looks like it's a simple syntax problem:
- you don't need a semicolon at the end of every line
- you do need a space delimiter between the command and the semicolon.
for example, WinWait, Sound;
is a problem but WinWait, Sound ;
is correct.
answered Jul 23 '15 at 7:03
paIncrease
1696
1696
add a comment |
add a comment |
up vote
0
down vote
For ControlClick:
I finally found my own solution after skimming the documentation more thoroughly:
https://autohotkey.com/docs/commands/ControlClick.htm#Reliability
You can specify NA as the sixth parameter to wait for the mouse button to lift.
I found that when firing Control, Check, ,Button1
prior to ControlClick
the click didn't work, but adding the NA
to the end somehow magically fixed it. I suppose a click was being simulated and had not yet lifted.
add a comment |
up vote
0
down vote
For ControlClick:
I finally found my own solution after skimming the documentation more thoroughly:
https://autohotkey.com/docs/commands/ControlClick.htm#Reliability
You can specify NA as the sixth parameter to wait for the mouse button to lift.
I found that when firing Control, Check, ,Button1
prior to ControlClick
the click didn't work, but adding the NA
to the end somehow magically fixed it. I suppose a click was being simulated and had not yet lifted.
add a comment |
up vote
0
down vote
up vote
0
down vote
For ControlClick:
I finally found my own solution after skimming the documentation more thoroughly:
https://autohotkey.com/docs/commands/ControlClick.htm#Reliability
You can specify NA as the sixth parameter to wait for the mouse button to lift.
I found that when firing Control, Check, ,Button1
prior to ControlClick
the click didn't work, but adding the NA
to the end somehow magically fixed it. I suppose a click was being simulated and had not yet lifted.
For ControlClick:
I finally found my own solution after skimming the documentation more thoroughly:
https://autohotkey.com/docs/commands/ControlClick.htm#Reliability
You can specify NA as the sixth parameter to wait for the mouse button to lift.
I found that when firing Control, Check, ,Button1
prior to ControlClick
the click didn't work, but adding the NA
to the end somehow magically fixed it. I suppose a click was being simulated and had not yet lifted.
answered Nov 21 at 2:56
adjenks
1011
1011
add a comment |
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f944150%2fautohotkeys-controlclick-set-default-not-working%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown