Closed GuilhermeBaldo closed 5 months ago
Hmm. When I test this, I get the expected result:
In [1]: from ahk import AHK
In [2]: ahk = AHK()
In [3]: ahk.key_down('A') # Press down (but do not release) A key
...: print(ahk.key_state('A'))
...: ahk.key_up('A') # Release the key
1
In [4]:
I'm not sure what might cause a situation where this prints 0
. I don't think the AutoHotkey version should matter, but I tested on 1.1.33.09
Thanks for the response @spyoungtech! Thats super odd. I will investigate it further, as this is a problem here and not in the tool. I think you can close the issue if you wish.
Sure thing. Feel free to open a new issue any time if you still have questions or can find a way we can reproduce the issue.
One last thought: you may find this comment useful, if it's the case that you are encountering this issue specifically when checking for the key state of a modifier key (like shift, alt, etc.) in close proximity to having AutoHotkey send input.
describe your issue
When trying to reproduce the example from the README.md of pressing and not releasing a key, and I got an unexpected result.
The following outputs 0, while I was expecting it to output 1 as A would be pressed. The key A is a placeholder, I tested with several different keys. Am I doing this wrong?
ahk.version
1.7.2
AutoHotkey version
v1
Code to reproduce the issue
Traceback/Error message
No response