 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
superdave2k
Joined: 15 Oct 2004 Posts: 19
|
Posted: Mon Mar 14, 2005 7:56 pm Post subject: ControlSend question |
|
|
I have a hotkey that sends some keystrokes to a window. The strange thing is, for it to do what I want, I have to break the code into two distinct statements. For example,
| Code: | | ControlSend, , !f{DOWN}{ENTER}, A |
Only seems to do the first part (the Alt-F to bring down the menu bar). The {DOWN} and {ENTER} seem to have no effect.
If I break it into two, it works!
| Code: | ControlSend, , !f, A
ControlSend, , {DOWN}{ENTER}, A |
Any idea why? I've played with SetKeyDelay (both params) since I figured it was possible the keys were being sent too quickly, but that did not help.
Also, I tried grabbing the WM_COMMAND via Winspector Spy so I could use PostMessage or SendMessage to accomplish what I want, but no messages appeared
Thanks in advance,
Dave |
|
| Back to top |
|
 |
jonny
Joined: 13 Nov 2004 Posts: 3004 Location: Minnesota
|
Posted: Mon Mar 14, 2005 8:01 pm Post subject: |
|
|
Send and it's relatives do a lot of stuff in the background, most of it fixing bugs. I suspect this is being caused by the separation making AHK do something it wouldn't otherwise.
But I can kinda guess what you're trying to do here, and I think the WinMenuSelectItem command would suit you better. |
|
| Back to top |
|
 |
superdave2k
Joined: 15 Oct 2004 Posts: 19
|
Posted: Mon Mar 14, 2005 8:18 pm Post subject: |
|
|
| jonny wrote: | | But I can kinda guess what you're trying to do here, and I think the WinMenuSelectItem command would suit you better. |
Unfortunately the window is non-standard (a Trillian IM window to be exact, which is skinned). I've already tried that function and it doesn't work. |
|
| Back to top |
|
 |
jonny
Joined: 13 Nov 2004 Posts: 3004 Location: Minnesota
|
Posted: Mon Mar 14, 2005 9:25 pm Post subject: |
|
|
If this doesn't work, you'll just have to keep them separate (is that so bad, anyway?):
| Code: | | controlsend,,{alt down}f{alt up}{down}{enter},a |
|
|
| Back to top |
|
 |
superdave2k
Joined: 15 Oct 2004 Posts: 19
|
Posted: Mon Mar 14, 2005 9:40 pm Post subject: |
|
|
| jonny wrote: | If this doesn't work, you'll just have to keep them separate (is that so bad, anyway?):
| Code: | | controlsend,,{alt down}f{alt up}{down}{enter},a |
|
Thanks, but that doesn't work either. I don't have a problem keeping them separate, I was just curious why that was necessary... |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Tue Mar 15, 2005 1:07 am Post subject: |
|
|
Offhand, I'm not sure why separate commands are necessary in this case. Since ControlSend uses tricks to get keystrokes to windows in the background, its reliability generally isn't as high as Send or ControlSetText.
If you ever discover a script that requires two ControlSends instead of one for something standard like Notepad, please post it. |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|