AutoHotkey Community

It is currently May 27th, 2012, 4:48 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 102 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7
Author Message
 Post subject:
PostPosted: February 13th, 2010, 8:46 pm 
@Mannu:
i guess that this alert is wrong. There are many files where some scanners throw a "suspicious" or "generic" alert...or can you provide proof?


Report this post
Top
  
Reply with quote  
 Post subject: Is there a way...
PostPosted: March 9th, 2010, 7:06 pm 
..I am new to AutoHotKey so other than making a few basic hotstring scripts and altering a few pre-existing scripts on the net I'm not knowledgeable enough to make what I wish. I’m finding AutoHotKey really useful in my data entry job and I need a script to select text like this one here, but either only in one application, a group of applications, or by double clicking mouse only. What would I need to add, remove or alter in this script to achieve even just the Double click? Tia


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 10th, 2010, 8:12 am 
..Reading through all 7 pages of this thread I found this code to work pretty good for me. I only need to have this work in one db program where I pull member ID data from & paste it into multiple other search db windows. I might also later wish to lock this down to work in maybe a small group of programs not just 1 or everyone, but I will have to figure that out 1st. Thank you Laszlo.



Laszlo wrote:
Here is a simplified version of the mouse handling. It gets the current double click time from the system and defines the left mouse button as a hotkey, not disturbing its original function.

When the hotkey is activated it checks if it was a double click. If yes, it waits a little to let the application mark the selection and sends Ctrl-C to copy it to the ClipBoard. If the click was not a double click, the subroutine waits until the mouse button is released. If in the mean time the mouse pointer was moved, some selection took place, so we can send Ctrl-C in this case, too. The selection is faster in this case, you may not even need Sleep.
Code:
DClickT := DllCall("GetDoubleClickTime") ; the system's double click time

~LButton::
   If (A_PriorHotKey = A_ThisHotKey && A_TimeSincePriorHotKey <= DClickT) { ; Double click
     ;MouseGetPos X, Y, WinID, Ctrl ; and test if the click is in the desired window and its client area
      Sleep 150                 ; Highlighting needs time. Tune it to your app
      Send ^c
      Return
   }
   MouseGetPos X0, Y0           ; Store starting mouse position
   KeyWait LButton              ; Wait until mouse button is released
   MouseGetPos X, Y
   If (Abs(X-X0)+Abs(Y-Y0) < 5) ; If not moved: nothing is selected
      Return
   Sleep 10                     ; Tune it to your app
   Send ^c
Return

This is a very simple script. It does not check if something meaningful was actually selected, but still it works quite reliably. Try it and post your findings.


Report this post
Top
  
Reply with quote  
 Post subject: Thanks...
PostPosted: March 10th, 2010, 8:12 am 
..Reading through all 7 pages of this thread I found this code to work pretty good for me. I only need to have this work in one db program where I pull member ID data from & paste it into multiple other search db windows. I might also later wish to lock this down to work in maybe a small group of programs not just 1 or everyone, but I will have to figure that out 1st. Thank you Laszlo.



Laszlo wrote:
Here is a simplified version of the mouse handling. It gets the current double click time from the system and defines the left mouse button as a hotkey, not disturbing its original function.

When the hotkey is activated it checks if it was a double click. If yes, it waits a little to let the application mark the selection and sends Ctrl-C to copy it to the ClipBoard. If the click was not a double click, the subroutine waits until the mouse button is released. If in the mean time the mouse pointer was moved, some selection took place, so we can send Ctrl-C in this case, too. The selection is faster in this case, you may not even need Sleep.
Code:
DClickT := DllCall("GetDoubleClickTime") ; the system's double click time

~LButton::
   If (A_PriorHotKey = A_ThisHotKey && A_TimeSincePriorHotKey <= DClickT) { ; Double click
     ;MouseGetPos X, Y, WinID, Ctrl ; and test if the click is in the desired window and its client area
      Sleep 150                 ; Highlighting needs time. Tune it to your app
      Send ^c
      Return
   }
   MouseGetPos X0, Y0           ; Store starting mouse position
   KeyWait LButton              ; Wait until mouse button is released
   MouseGetPos X, Y
   If (Abs(X-X0)+Abs(Y-Y0) < 5) ; If not moved: nothing is selected
      Return
   Sleep 10                     ; Tune it to your app
   Send ^c
Return

This is a very simple script. It does not check if something meaningful was actually selected, but still it works quite reliably. Try it and post your findings.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 10th, 2010, 11:37 pm 
Doesn't work in CMD windows !!

Any fix for this issue?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 11th, 2010, 12:12 am 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
bhawk2 wrote:
Doesn't work in CMD windows
It needs a different approach: Send Alt-Space / E(dit) / (Mar)k - then use the mouse to select something, and at LButton-Up send Enter to copy the selection to the clipboard. As said before, there is no universal solution in Windows.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 21st, 2010, 8:46 am 
Offline

Joined: September 20th, 2006, 2:05 pm
Posts: 73
My simple approach:
:P

Code:
~LButton::
   ClickTime = % A_TickCount
return

~LButton Up::
   If % A_TickCount - ClickTime > 500
      SendInput, ^c
return


Alternatively

Code:
~LButton::
   MouseGetPos, x1, y1
   ClickTime = % A_TickCount
return

~LButton Up::
   MouseGetPos, x2, y2
   If % (A_TickCount - ClickTime > 2000) && (Abs(X-X0)+Abs(Y-Y0) < 5)
      SendInput, ^c
return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 28th, 2010, 6:19 pm 
i'm the coder for the autoclipcopy extension for k-meleon. all my extensions whether written in ahk or autoit DO NOT contain any malicious code.

ahk or autoit compiled binaries are UPX compressed which makes them get flagged as malware by some stupid antiviruses.

please mannuu, before accusing my scripts or anyone else's for that matter, read about false positives and packed binaries because antiviruses tend to always flag them by mistake.

furthermore, i would like to add that all extensions come with the sourcecode. you can easily examine the code yourself and compile it and you will see that your stupid scanner will still report it as malware.

do not dare to accuse decent developers of something that they will never do before you examine the code.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 19th, 2011, 2:14 am 
Offline

Joined: July 23rd, 2010, 9:41 am
Posts: 7
Laszlo's script Works nicely for selecting text, but it didn't work for me for the double clicks.

So I tweaked it bit, basically adding a A_TickCount to keep track
of double click time.

Code:
~LButton::
   if (A_TickCount-DClickT < LastClickTick ) { ; double-click detected
     Sleep 50 ; Highlighting needs time. Tune it to your app
     Send ^c
     Return
   }
LastClickTick := A_TickCount
   MouseGetPos X0, Y0           ; Store starting mouse position
   KeyWait LButton              ; Wait until mouse button is released
   MouseGetPos X, Y
   If (Abs(X-X0)+Abs(Y-Y0) < 5) ; If not moved: nothing is selected
      Return
   IfWinActive, Inbox - Microsoft Outlook
   {
    Return   
   }
   Sleep 10                     ; Tune it to your app
   Send ^c
Return


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: Is there a way...
PostPosted: August 27th, 2011, 1:05 pm 
jeffreygxd wrote:
..I am new to AutoHotKey so other than making a few basic hotstring scripts and altering a few pre-existing scripts on the net I'm not knowledgeable enough to make what I wish. I’m finding AutoHotKey really useful in my data entry job and I need a script to select text like this one here, but either only in one application, a group of applications, or by double clicking mouse only. What would I need to add, remove or alter in this script to achieve even just the Double click? Tia


I made an exe file from the code that it exist at the first post and it works fine for me.
Run this and u dont need do anything else :wink:

http://www.4shared.com/file/TQKt2jus/autocopy.html


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 27th, 2011, 1:09 pm 
Lol, I just saw that the post was 1 year old.. Nevermind, I hope this file to help someone at least :lol:


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 27th, 2011, 4:24 pm 
Ok, I found that finally there is an annoy problem with that code from the first post, so I deleted the above script and I made a simple one just for autocopy function.
Here is the link for the new exe file
http://www.4shared.com/file/dyufpEGy/ArvaCopy.html

and the code if someone wants this

Code:
DClickT := DllCall("GetDoubleClickTime") ; the system's double click time

~LButton::
   If (A_PriorHotKey = A_ThisHotKey && A_TimeSincePriorHotKey <= DClickT) ; Double click
      Send ^c
Return


It works perfect, it do what it says and without giving any annoying "ccccc" letters when you type..


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 102 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 13 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