 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
SanskritFritz
Joined: 17 Feb 2005 Posts: 283 Location: Hungary, Budapest
|
Posted: Tue May 03, 2005 12:06 pm Post subject: $RButton:: hinders drag and drop |
|
|
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 |
|
 |
Laszlo
Joined: 14 Feb 2005 Posts: 4078 Location: Pittsburgh
|
Posted: Tue May 03, 2005 1:50 pm Post subject: |
|
|
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 |
|
 |
SanskritFritz
Joined: 17 Feb 2005 Posts: 283 Location: Hungary, Budapest
|
Posted: Tue May 03, 2005 2:18 pm Post subject: |
|
|
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 |
|
 |
Laszlo
Joined: 14 Feb 2005 Posts: 4078 Location: Pittsburgh
|
Posted: Tue May 03, 2005 3:33 pm Post subject: |
|
|
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 |
|
 |
SanskritFritz
Joined: 17 Feb 2005 Posts: 283 Location: Hungary, Budapest
|
Posted: Wed May 04, 2005 11:46 am Post subject: |
|
|
Brilliant, thanks!
Az ötlet egészen kiváló, köszi! _________________ Is there another word for synonym? |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|