Jump to content



Recommended Posts

Hey, sorry if this has been asked allready... Didn't see it when I did a search.

Anyone know if it's possible to set the middle mouse button as a hotkey to start a function?

Thanks a million guys!


I do not know if it can be done directly but the following will work

#Include <Misc.au3>

HotKeySet("{F9}", "ShowMessage")

While 1
if _IsPressed(04) Then

Func ShowMessage()
    MsgBox(4096,"","This is a message.")

I know there are probably better ways to do it but no-one else was answering.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

There probably isn't any fantastic solution to achieving this with AutoIt because AutoIt doesn't take advantage of 'hooks' to watch mouse events. Consequently you would need to use a loop (like BigDod suggested) which will eat unnecessary CPU.

I don't like to plug non-AutoIt software here but you may want to look at PowerPro, which will allow you to assign all sorts of actions to all sorts of events including middle click, bump screen side/corner, caption double-click, right mouse drag down etc.

Your action can then trigger an event such as running an AutoIt script.

Link to comment
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...