AutoHotkey Community

It is currently May 26th, 2012, 9:14 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 11 posts ] 
Author Message
PostPosted: July 26th, 2009, 5:27 am 
Offline

Joined: January 8th, 2009, 12:42 am
Posts: 51
I am doing just as my title says. I need to copy highlighted text without ctrl+c

the site I'm doing it on has blocked that

but u can actually right click and copy

so, how do I go about doing this?

as in, if I highlight something, it becomes copied to the clipboard without using ctrl+c

like:

clipboard = highlighted text


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 26th, 2009, 5:53 am 
Try the other windows copy shortcut key: control+insert
Code:
^w::SendInput ^{Insert}


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: July 26th, 2009, 6:25 am 
Thanks but control is blocked, so it wouldnt work


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: July 26th, 2009, 6:35 am 
7usabball not logged in wrote:
Thanks but control is blocked, so it wouldnt work
Well, if the selected text is in a "standard" windows edit control, you can try ControlGet, outvar, Selected,...

Otherwise you are SOL (unless you are into screen capture and character recognition).


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: July 26th, 2009, 6:58 am 
Ill try controlget

And lol, i hope to make a text image recognition software some day in the future


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: July 26th, 2009, 8:53 am 
Offline

Joined: August 14th, 2006, 11:54 am
Posts: 163
Location: CPH
Try this:

Code:
;AUTOCOPY TO CLIPBOARD=============================================
 
~Lshift::
TimeButtonDown = %A_TickCount%
; Wait for it to be released
Loop
{
   Sleep 10
   GetKeyState, LshiftState, Lshift, P
   if LshiftState = U  ; Button has been released.
      break
   elapsed = %A_TickCount%
   elapsed -= %TimeButtonDown%
   if elapsed > 200  ; Button was held down long enough
   {
      x0 = A_CaretX
      y0 = A_CaretY
      Loop
   {
     Sleep 20                    ; yield time to others
     GetKeyState keystate, Lshift
     IfEqual keystate, U, {
       x = A_CaretX
       y = A_CaretY
       break
     }
   }
   if (x-x0 > 5 or x-x0 < -5 or y-y0 > 5 or y-y0 < -5)
   {                             ; Caret has moved
      clip0 := ClipBoardAll      ; save old clipboard
      ;ClipBoard =
      Send ^c                    ; selection -> clipboard
      ClipWait 1, 1              ; restore clipboard if no data
   }
      return
   }
}

~LButton::
MouseGetPos, xx
TimeButtonDown = %A_TickCount%
; Wait for it to be released
Loop
{
   Sleep 10
   GetKeyState, LButtonState, LButton, P
   if LButtonState = U  ; Button has been released.
   {
      If WinActive("Crimson Editor") and (xx < 25) ; Single Click in the Selection Area of CE
      {
         Send, ^c
         return
      }
      break
   }
   elapsed = %A_TickCount%
   elapsed -= %TimeButtonDown%
   if elapsed > 200  ; Button was held down too long, so assume it's not a double-click.
   {
      MouseGetPos x0, y0            ; save start mouse position
      Loop
   {
     Sleep 20                    ; yield time to others
     GetKeyState keystate, LButton
     IfEqual keystate, U, {
       MouseGetPos x, y          ; position when button released
       break
     }
   }
   if (x-x0 > 5 or x-x0 < -5 or y-y0 > 5 or y-y0 < -5)
   {                             ; mouse has moved
      ;ClipBoard =
      Send ^c                    ; selection -> clipboard
      SoundPlay, C:\WINDOWS\Media\Windows XP Menu Command.wav
      ClipWait 1, 1              ; restore clipboard if no data
   }
      return
   }
}
Return

;--------------------------------------------------------------------------------


Thanks to the unknown and long forgotten author 8)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 26th, 2009, 6:51 pm 
Thanks, but that wont work either because its still using ctrl+c

That seems very useful tho, but not now


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: July 27th, 2009, 11:23 am 
Offline

Joined: March 23rd, 2005, 7:53 am
Posts: 321
Location: Germany
Use the AppsKey (context menu)
Code:
SetTitleMatchMode, 2
#IfWinActive, the uncopiable application  ;put part of the name of that window here
^c::
clipboard=
send, {AppsKey}c
ClipWait, 2
MsgBox, %clipboard%
return
#IfWinActive


Tested.

_________________
Hasso

Programmers don't die, they GOSUB without RETURN


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 27th, 2009, 1:40 pm 
Offline

Joined: February 2nd, 2008, 4:35 am
Posts: 643
Carlol wrote:
Try this:
Code:
;AUTOCOPY TO CLIPBOARD=============================================
...


You could TRY FireFox + AutoCopy extension (doesnt use ctrl+c ??)


Report this post
Top
 Profile  
Reply with quote  
PostPosted: July 27th, 2009, 5:16 pm 
You can do this easily (and in a single line) by sending {AppsKey}, which generally duplicates a Right Click. "Send,{AppsKey}c" works fine copying for me.


Report this post
Top
  
Reply with quote  
PostPosted: July 27th, 2009, 6:24 pm 
Offline

Joined: March 23rd, 2005, 7:53 am
Posts: 321
Location: Germany
koeselitz wrote:
You can do this easily (and in a single line) by sending {AppsKey}, which generally duplicates a Right Click. "Send,{AppsKey}c" works fine copying for me.

... just what I said two posts above :mrgreen: :mrgreen:

_________________
Hasso

Programmers don't die, they GOSUB without RETURN


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, krajan, patgenn123, wolverineks, Yahoo [Bot] and 63 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