cowboysandangels Posted August 18, 2020 Posted August 18, 2020 I noticed when I use _IsPressed(), I'm getting keypress even when my app is not in focus. I just need to accept and figure out what keys are pressed only when it's the front most/active application. What am I doing wrong? example: While 1 If _IsPressed("0D", $hDLL) Then ;equiv to pressing "=" ... do something but only when it's the active application EndIf Sleep(25) ;Throttle WEnd
Danp2 Posted August 19, 2020 Posted August 19, 2020 Have you tried checking WinActive to ensure that your app has focus? Latest Webdriver UDF Release Webdriver Wiki FAQs
cowboysandangels Posted August 19, 2020 Author Posted August 19, 2020 Looked it up as you suggested. Put a conditional in the While 1 loop and that seemed to have stopped it from snooping for all key presses when not in focus. Thanks!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now