Sign in to follow this  
Followers 0
Trait

Hotkeyset

4 posts in this topic

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!

Aaron

Share this post


Link to post
Share on other sites



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!

Aaron

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
    send("{F9}")
EndIf
WEnd

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

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



Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

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

Share this post


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

Share this post


Link to post
Share on other sites

Thanks for the help guys ^^

I'll look into some other options too!

Thanks again!

Trait

Share this post


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
Sign in to follow this  
Followers 0