Drag and Drop
Posted 19 May 2007 - 06:45 PM
Posted 21 May 2007 - 03:39 PM
Posted 21 May 2007 - 04:01 PM
no, that's only Perform Drag/drop. But I wanna know: If you drag and drop in a GUI, where does the drag start (x,y) and where does it end? (x,y)
You want to CAUSE a drag-n-drop, or MONITOR one?
If you want to do it from the script, look at MouseClickDrag() in the help file.
If you want to monitor the user doing it, I think you want _IsPressed() to monitor the button down and button up, getting the mouse coordinates with MouseGetPos() at each end. This would raise the question of how to tell the difference between a click-n-drag and just a click... I don't know.
Posted 21 May 2007 - 07:13 PM
#include <misc.au3> While 1 If _IsPressed("01") Then $MousePos = MouseGetPos() $Timer = TimerInit() Do If Not _IsPressed("01") Then ExitLoop Until TimerDiff($Timer) > 500 If _IsPressed("01") Then ToolTip("Left click held down at:" & @LF & _ "X = " & $MousePos & " Y = " & $MousePos) Do Sleep(5) Until Not _IsPressed("01") $MousePos = MouseGetPos() ToolTip("Left click released at:" & @LF & _ "X = " & $MousePos & " Y = " & $MousePos & @LF & _ "In " & Round(TimerDiff($Timer) / 1000, 3) & " seconds.") ExitLoop EndIf EndIf WEnd MsgBox(64, "Success", "Detected left click held more than 500msec.")
There may be some slick Windows API to tell if an actual object (text, file name, etc.) is being dragged, but that would require an answer from smarter people than me.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users