| View previous topic :: View next topic |
| Author |
Message |
Peepsalot
Joined: 06 Oct 2005 Posts: 24
|
Posted: Sun Oct 09, 2005 3:33 am Post subject: Can Input be substituted for KeyWait? |
|
|
I was looking at the Input function, and it seems like it is capable of performing the same thing. I have a script that uses KeyWait, so I tried replacing it with a call to Input, but it isn't functioning the same. I don't understand what the difference is really.
original snippet of KeyWait code
| Code: |
KeyWait Down, T0.03
if (ErrorLevel)
...
|
Input code that doesn't work the same, and I don't know why:
| Code: |
Input dummyVar, T0.03, {Down}
if (ErrorLevel="Timeout")
...
|
|
|
| Back to top |
|
 |
shimanov
Joined: 25 Sep 2005 Posts: 610
|
Posted: Sun Oct 09, 2005 4:04 am Post subject: Re: Can Input be substituted for KeyWait? |
|
|
| Code: |
KeyWait Down, T0.03
if (ErrorLevel)
...
|
KeyWait by default waits for the key to be released (up). Therefore, there is not a timeout condition, but rather KeyWait returns with ErrorLevel = 0.
| Code: |
Input dummyVar, T0.03, {Down}
if (ErrorLevel="Timeout")
...
|
Input waits for the key to be depressed (down). Therefore, there is a timeout condition if the key specified as an "EndKey" is not pressed. |
|
| Back to top |
|
 |
Peepsalot
Joined: 06 Oct 2005 Posts: 24
|
Posted: Sun Oct 09, 2005 9:30 am Post subject: |
|
|
and Input can't be made to check for a key up even with something like this?
Input dummyVar, T0.03, {Down up} |
|
| Back to top |
|
 |
shimanov
Joined: 25 Sep 2005 Posts: 610
|
Posted: Sun Oct 09, 2005 5:42 pm Post subject: |
|
|
| Peepsalot wrote: | and Input can't be made to check for a key up even with something like this?
Input dummyVar, T0.03, {Down up} |
No. Input is waiting for a key to be pressed. That is its behavior by design.
Why do you want to replace KeyWait with Input? |
|
| Back to top |
|
 |
Peepsalot
Joined: 06 Oct 2005 Posts: 24
|
Posted: Sun Oct 09, 2005 7:24 pm Post subject: |
|
|
| Just trying to learn the different uses for all the functions. Thanks for the help. |
|
| Back to top |
|
 |
|