AutoHotkey Community

It is currently May 27th, 2012, 6:16 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: November 21st, 2010, 10:55 pm 
Offline

Joined: April 9th, 2008, 8:46 am
Posts: 35
Location: Espoo, Finland
Making mouse buttons context sensitive (depending on application) with AHK should be quite a normal operation, but currently to make it work properly I need some explicit extra checks in the subroutine.
E.g.
Code:
MButton::
MouseGetPos,,, hwnd
WinActivate, ahk_id %hwnd%

IfWinNotActive ahk_class OperaWindowClass
   Click 2
Else
   Click, Middle
   
return


Wouldn't it be more convenient if that was the default behavior for mouse hotkeys? So to get the same behavior you'd only type:
Code:
#IfWinNotActive ahk_class OperaWindowClass
MButton::Click 2
#IfWinActive


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 22nd, 2010, 2:59 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
See #If; specifically, Example 1. AutoHotkey_L required.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 5 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group