AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

$RButton:: hinders drag and drop

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
SanskritFritz



Joined: 17 Feb 2005
Posts: 283
Location: Hungary, Budapest

PostPosted: Tue May 03, 2005 12:06 pm    Post subject: $RButton:: hinders drag and drop Reply with quote

Example script:
Code:
$RButton::
   MouseGetPos sf_xPos, sf_yPos, , sControlClicked
   if (sControlClicked = "MyWindowClass1")
      ; No right button here!
      Send {LButton}
   else
      Send {RButton}
Return

My problem:
Right button drag and drop is not working anymore (systemwide).
My question:
Is is possible to get the RButton event only if the mouse did not move between the button down and up events?
_________________
Is there another word for synonym?
Back to top
View user's profile Send private message
Laszlo



Joined: 14 Feb 2005
Posts: 4078
Location: Pittsburgh

PostPosted: Tue May 03, 2005 1:50 pm    Post subject: Reply with quote

Probald ezt (Try this)
Code:
~$RButton::
   MouseGetPos sf_xPos0, sf_yPos0
Return

~$RButton Up::
   MouseGetPos sf_xPos, sf_yPos
   If (sf_xPos<>sf_xPos0 ||  sf_yPos<>sf_yPos0)
      Return
   MsgBox Nem mozdult
Return
Back to top
View user's profile Send private message
SanskritFritz



Joined: 17 Feb 2005
Posts: 283
Location: Hungary, Budapest

PostPosted: Tue May 03, 2005 2:18 pm    Post subject: Reply with quote

Köszi, thanks for the script. The problem with that is, that i want to swallow the right click and issue a left click instead, but leave the right drag otherwise intact.
_________________
Is there another word for synonym?
Back to top
View user's profile Send private message
Laszlo



Joined: 14 Feb 2005
Posts: 4078
Location: Pittsburgh

PostPosted: Tue May 03, 2005 3:33 pm    Post subject: Reply with quote

Something along this line might work. (It is not perfect, csiszold tovabb).
Code:
$RButton::
   MouseGetPos x0, y0                  ; starting mouse position
   Loop
   {
      Sleep 20                         ; give time to others
      GetKeyState State, RButton, P
      MouseGetPos x, y                 ; new position
      moved := x-x0>5 || x0-x>5 || y-y0>5 || y0-y>5
      if ( State = "D" && not moved)   ; keep waiting for change
         continue
      if ( State = "D" && moved )      ; right drag
      {
         HotKey $Rbutton, off
         MouseClick Right, x0, y0, 1, 0, D
         Break
      }
      if ( State = "U" && not moved )  ; right click
      {
         MouseClick Left, x, y, 1, 0
         Break
      }
      if ( State = "U" && moved )      ; click & move
      {
         MouseClick Right, x, y, 1, 0
         Break
      }
   }
Return

~$RButton Up::                         ; re-enable hotkey
   HotKey $RButton, on
Return
Back to top
View user's profile Send private message
SanskritFritz



Joined: 17 Feb 2005
Posts: 283
Location: Hungary, Budapest

PostPosted: Wed May 04, 2005 11:46 am    Post subject: Reply with quote

Brilliant, thanks!
Az ötlet egészen kiváló, köszi!
_________________
Is there another word for synonym?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group