 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
pantagruel
Joined: 08 Oct 2006 Posts: 91 Location: denmark
|
Posted: Mon Jun 09, 2008 12:23 pm Post subject: Why does KeyWait not Wait? |
|
|
Hey,
I have
| Code: |
SetTitleMatchMode,2
IfWinNotExist,%gbstitle%
{
GoSub,gogb
KeyWait, x
MsgBox, worked
WinMaximize,%gbstitle%
}
|
and the gogb sub is
| Code: | gogb:
Run IEXPLORE.EXE %gbssite%
Return
|
The problem when I run it the msgbox pops up immediately with worked, which strikes me weird, I want to basically pause until the key I'm waiting for is hit. |
|
| Back to top |
|
 |
HugoV
Joined: 27 May 2007 Posts: 650
|
Posted: Mon Jun 09, 2008 12:37 pm Post subject: |
|
|
Running this simple code | Code: | KeyWait, X
MsgBox OK | shows me it only works when I have already pressed X before I run the script. So unless you have X pressed down before the code is executed it will simply continue. Why not use WinWaitActive or IfWinExist to "wait". or lookin to the D option of Keywait |
|
| Back to top |
|
 |
Klaus
Joined: 12 May 2005 Posts: 205 Location: Münster, Germany
|
Posted: Mon Jun 09, 2008 12:53 pm Post subject: |
|
|
Hi, pantagruel,
You should use the D-option for KeyWait (like HugoV proposed),
because "KeyWait,x" (means: wait until the x-key is released) is always true except x is hold down when function is launched.
Regards,
Klaus |
|
| 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
|