bleh Posted March 3, 2016 Share Posted March 3, 2016 Hey, I want to leave an autoit file running in the background that looks for a key i press. However, is it possible to "hook" the key that the key press ONLY sends to the autoit script and not to whatever program i currently work in? Link to comment Share on other sites More sharing options...
InunoTaishou Posted March 3, 2016 Share Posted March 3, 2016 Your first sentence sounds like a keylogger. Your second sentence sounds like you want to use AccelKeys. Accel keys are like hotkeys that are only active when your GUI is in focus. What are you trying to do? Could we get some more info. Link to comment Share on other sites More sharing options...
bleh Posted March 3, 2016 Author Share Posted March 3, 2016 No, if i wanted a keylogger it would have to look for every key pressed, wouldn't it? I want to control an autoit script that is running in the background with my keyboard. Let's say with the F1 key. Now the problem is, if i am in - for example - notepad and press F1, it will open the windows help, i don't want that. I want to know if there is a way that the F1 key only gets recognized by autoit and not by notepad, while focus is not on the autoit script. Link to comment Share on other sites More sharing options...
InunoTaishou Posted March 3, 2016 Share Posted March 3, 2016 HotKeySet("{F1}", "Function") Link to comment Share on other sites More sharing options...
Bert Posted March 3, 2016 Share Posted March 3, 2016 hotkeyset is what you want. Understand you have to be careful for if you just use it without regard to the the window that has focus you can have undesired results. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
bleh Posted March 3, 2016 Author Share Posted March 3, 2016 This works great! Exactly what i was looking for. Thanks to you two! Thanks Link to comment Share on other sites More sharing options...
Miloud Posted March 4, 2016 Share Posted March 4, 2016 Yes you càn https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwjh46PV3qXLAhXjIJoKHcNvASEQFggcMAA&url=https%3A%2F%2Fautoit.de%2Findex.php%2FThread%2F43012-GUIRegisterMsg-WM-KEYDOWN-funktioniert-nicht-KEYUP-geht%2F&usg=AFQjCNE_ZkRHTnzZu9DmtNtblvwTnNcHLw&bvm=bv.115339255,d.bGs Link to comment Share on other sites More sharing options...
TheSaint Posted March 4, 2016 Share Posted March 4, 2016 Another way of course, is to use _IsPressed, but you would need to be careful, and certainly use the DLL option for repetitive checking. That could solve the issue regarding another active program, but will chew up processing cycles if called too often, so a Sleep would be necessary. You would have to make it a unique key combo as well, or risk issues related to that, when using an editor or any program that takes input, etc. Make sure brain is in gear before opening mouth! Remember, what is not said, can be just as important as what is said. Spoiler What is the Secret Key? Life is like a Donut If I put effort into communication, I expect you to read properly & fully, or just not comment. Ignoring those who try to divert conversation with irrelevancies. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage) Link to comment Share on other sites More sharing options...
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