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 

MouseClickDrag with the push of a button?

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Phoenix007
Guest





PostPosted: Tue Mar 24, 2009 7:51 pm    Post subject: MouseClickDrag with the push of a button? Reply with quote

Hi all,i just started with autohotkey and i got a problem, i try to use "MouseClickDrag, L, x, x, 1638, 843"

What i want is, how do i keep the program open? When i execute the above file, it moves the file to 1638, 843 (y,x) and nothing else happends.

Say if i want to move more files and "drag" it to "Trash bin",(or whatever it is in english)Trash bin is located at 1638,843. Is there some way to launch the program and then it doesnt do anything untill i press a button? Lets say i want to delete a notepad note (its at desktop), without right clicking and go delete (i want to learn the basics).

So i launch the program and hit button"P" or anything double click or whatever. and the file gets dragged to 1638,843 and drops it there. Is this possible? If yes can you show me the script?


Thanks in advance!

Phoenix007
Back to top
Phoenix007
Guest





PostPosted: Tue Mar 24, 2009 8:01 pm    Post subject: Reply with quote

also that, i want to move more files without launching the program again. Just simple pressing the "whatever-key" again
Back to top
Phoenix007
Guest





PostPosted: Tue Mar 24, 2009 10:06 pm    Post subject: Reply with quote

or to make it more simpler, i want a program that can, at a push of a button; move a object(desktop icon) to a certain point on the screen. By dragging the object and drop it at the selected (x,y) location instantly.

Example: I launch the program, click on a object, and the object gets dragged instantly to the (x,y) location

Cmon that cant be so hard? if anyone do know how to script it, id greatly appreciate it.
Back to top
Robbo



Joined: 27 Jul 2008
Posts: 47
Location: England

PostPosted: Tue Mar 24, 2009 11:22 pm    Post subject: Reply with quote

You may want to take a look at this page:
http://www.autohotkey.com/docs/Hotkeys.htm

As for your suggestion of the "P" button:
Code:
P::
MouseClickDrag, L, x, x, 1638, 843
Return

_________________
All scripts are untested unless otherwise mentioned.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
sinkfaze



Joined: 18 Mar 2008
Posts: 5043
Location: the tunnel(?=light)

PostPosted: Tue Mar 24, 2009 11:26 pm    Post subject: Reply with quote

Untested:

Code:
!x:: ; hotkey Alt + x
Click down ; sends a 'down' click to the mouse wherever it's located
Click up 1638, 843 ; releases from the 'down' state once the mouse is at those coordinates
return

_________________
Try Quick Search for Autohotkey or see the tutorial for newbies.
Back to top
View user's profile Send private message Send e-mail
Phoenix007
Guest





PostPosted: Wed Mar 25, 2009 3:13 pm    Post subject: Reply with quote

thanks alot guys Smile works wonder, just to speed up process, is there any way to make the mouse returning back to the original point after placing the object there? i dont know the starting location but i know the drop location
Back to top
sinkfaze n-l-i
Guest





PostPosted: Wed Mar 25, 2009 3:56 pm    Post subject: Reply with quote

Code:
!x::
MouseGetPos Px, Py ; saves the mouse's current coordinates to variables
Click down
Click up 1638, 843
Click %Px%, %Py%, 0 ; moves the mouse to the coordinates contained in the variables without clicking
return
Back to top
Phoenix007
Guest





PostPosted: Wed Mar 25, 2009 6:12 pm    Post subject: Reply with quote

thanks alot sinkfaze Very Happy now what i wonder is it pssoble to do it with the mouse? say mousebutton 4 or 5 or the mousewheel button as if now it is "!x::" can i make it "Mousebutton4::" ?
Back to top
Display posts from previous:   
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