Jump to content

Is it possible to "hook" keys?

Recommended Posts


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 post
Share on other sites

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 post
Share on other sites

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.


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 post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...