You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
key_wait seems to return immediately, rather than actually waiting for the key.
Additionally, the return values are different in AHK v1 versus AHK v2. In v1, a return value of 1 means there was a timeout, in v2, the opposite is true.
Lastly, a TimeoutError is never raised in any circumstance, contradicting the README documentation.
It's unclear how long this has been broken, but it has been broken for at least 6 months.
To smooth over the API differences between v1 and v2, the proposal is that key_wait be modified to:
return a bool, rather than an int: False will mean there was a timeout and True will mean the key was pressed. This more closely resembles the v2 behavior
not raise a TimeoutError
The API usage will now look like:
ifkey_wait(key, timeout=1):
print(key, 'was pressed')
else:
print(key, 'was not pressed')
Technically, this is a breaking change for AHK v1 users... but since key_wait has seemingly been broken for over 6 months, it probably doesn't matter that much.
The text was updated successfully, but these errors were encountered:
key_wait
seems to return immediately, rather than actually waiting for the key.Additionally, the return values are different in AHK v1 versus AHK v2. In v1, a return value of
1
means there was a timeout, in v2, the opposite is true.Lastly, a
TimeoutError
is never raised in any circumstance, contradicting the README documentation.It's unclear how long this has been broken, but it has been broken for at least 6 months.
To smooth over the API differences between v1 and v2, the proposal is that
key_wait
be modified to:bool
, rather than anint
:False
will mean there was a timeout andTrue
will mean the key was pressed. This more closely resembles the v2 behaviorTimeoutError
The API usage will now look like:
Technically, this is a breaking change for AHK v1 users... but since
key_wait
has seemingly been broken for over 6 months, it probably doesn't matter that much.The text was updated successfully, but these errors were encountered: