AutoHotkey Community

It is currently May 26th, 2012, 7:53 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: June 9th, 2008, 10:38 pm 
Offline

Joined: June 9th, 2008, 10:28 pm
Posts: 6
I have a script that watches for the left and right mouse button to be clicked and proceeds with an action. The problem I have is that right mouse button functionality is then replaced with nothing. I figured out how to restore the right mouse button single click, but I can't seem to get the right mouse button click and drag to work.

Anyone have any suggestions?

Code:
; Activate when Right and Left mouse buttons are clicked       
RButton & LButton::

    ;Sleep to make sure it was a quick-click
    Sleep 100
   
    ; Get state of right mouse button
    GetKeyState, RButtonState, RButton, P
   
    ;Right Mouse Button has been released continue
    IF RButtonState = U
    {
        ;Look for window named "RemoteCaptureTask" and activate it
        IfWinExist RemoteCaptureTask
        {
            WinActivate
            WinWaitActive
            Loop 2 {
                Send {F1}
            }

        } Else {
            msgbox Remote Capture is not open
        }
        return
    }
   
RButton::Send {Click Right}


Thanks!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 9th, 2008, 10:48 pm 
Code:
; Activate when Right and Left mouse buttons are clicked       
~RButton & LButton::

    ;Sleep to make sure it was a quick-click
    Sleep 100
   
    ; Get state of right mouse button
    GetKeyState, RButtonState, RButton, P
   
    ;Right Mouse Button has been released continue
    IF RButtonState = U
    {
        ;Look for window named "RemoteCaptureTask" and activate it
        IfWinExist RemoteCaptureTask
        {
            WinActivate
            WinWaitActive
            Loop 2 {
                Send {F1}
            }

        } Else {
            msgbox Remote Capture is not open
        }
        return
    }
return


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: June 10th, 2008, 2:50 pm 
Offline

Joined: June 9th, 2008, 10:28 pm
Posts: 6
That did it!

So all I needed to do was add a tilde to the first line? I'm assuming the tilde tells the script to watch for but not replace the functionality of the action, is that correct? I couldn't find any information on the the tilde in introductory documentation.

Thanks a ton!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 10th, 2008, 3:01 pm 
Offline

Joined: May 27th, 2007, 9:41 am
Posts: 4999
More on ~ here (see modifier symbols)
http://www.autohotkey.com/docs/Hotkeys.htm


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 10th, 2008, 3:02 pm 
Offline

Joined: June 9th, 2008, 10:28 pm
Posts: 6
Thanks!


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: poserpro and 65 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