AutoHotkey Community

It is currently May 26th, 2012, 3:32 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: desktop rightclick
PostPosted: March 16th, 2009, 11:40 am 
Offline

Joined: December 15th, 2008, 12:27 pm
Posts: 13
Hi,

I'm trying to write a script for detecting when the desktop is rightclicked, and show an ObjectBar menu (by sending it's activation hotkey) instead of showing the default Vista desktop rightclick menu.

Of course, if anything other is rightclicked (application, taskbar, window titlebars, tray icons, etc) the right click must be passed.

I'm almost fine with my script like this:

Code:
SetTitleMatchMode, 2

RButton::

IfWinActive, Firefox
{
ControlSend,,{RButton},Firefox
}


MouseGetPos,,,winid
WinGetTitle, wintit, ahk_id %winid%
If wintit= Program Manager
send ^q
else
send {RButton}
return


The only thing that's not working well is my mouse gestures in Firefox, where you have to move your mouse while pressing the right mouse button. What happens there is that a single rightclick happens on the page, but the mouse gesture is not initiated. I guess because I simply send a finished rightclick action to the browser.

So I thought if it's firefox below my mouse, I should only send the half of what I'm doing now, just the RButton pressing without releasing it like this:
Code:
IfWinActive, Firefox
{
Send {Click down right}
}

which is still not OK, also brings up rightclick menu in firefox.

Also what I recognized is that the RButton:: hotkey definition is triggered already when pressing the right mouse button before releasing it.

Is there any way to handle this correctly?

Many thanks
Andras


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 16th, 2009, 5:24 pm 
Offline

Joined: December 15th, 2008, 12:27 pm
Posts: 13
I got a great hint from lazz0 in the IRC channel.
Here I am now:
Code:
#IfWinNotActive, ahk_class MozillaUIWindowClass
RButton::
MouseGetPos,,,winid
WinGetTitle, wintit, ahk_id %winid%
If wintit= Program Manager
   Send, ^q
else
   send {RButton}
#IfWinActive

return


Which is almost perfect. Two issues:
Minor: rightclick context menus are displayed when pressing the right mouse button, while they should after releasing it.
Major: my custom action (sending ^q) is fired also when rightclicking a desktop icon.

Could anyone assist me in these?

thanks
Andras


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: BrandonHotkey, Yahoo [Bot] and 15 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