Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Ctrl + v (SendInput ^v) is not working in many applications


  • Please log in to reply
10 replies to this topic
Revil
  • Members
  • 23 posts
  • Last active: Jun 04 2013 12:55 PM
  • Joined: 12 Jan 2012
Hello,
I am creating a few functions that change selected text. The functions just copy text (Ctrl + c and ClipWait), change it and then paste it (SendInput ^v). Text have to be pasted by Ctrl + v because the text is usually a big paragraph and SendInput {Raw}%Clipboard% takes too long.

Everything works fine but today a realized that functions does not works in some applications. I tested functions in Notepad and in Notepad there are OK. They did not worked in some Microsoft Office applications but I know that MS Office use own clipboard history so I thought that it somehow cripple the functions and so I did not try to correct it. But today I found that functions also cannot be used in PSPad and UEStudio (programming editors) and that is bad. I found that copying works but pasting do not.

I am looking for solution but I cannot find the answer. Please does anybody know why the pasting is not working in so many applications? Is there some solution? I found something about COM calls but I do not know if it it can replace Ctrl + c and Ctrl + v.

Thank you very much.

P.S. I am using clipboard manager Ditto but I think that this is not a problem...

  • Guests
  • Last active:
  • Joined: --
I use UE and paste all day long with AutoHotkey.
Without seeing your code it is hard to tell what the problem is, you also don't describe what doesn't work, do you paste the old clipboard content or paste nothing etc.

Try adding sleep after you assign new content to the clipboard, better yet use <!-- m -->http://www.autohotke... ... #Clipboard<!-- m --> Clip() VirClip or Winclip

And yes, turn off your ditto manager as a test, it might indeed be the culprit. I use CLCL which works perfect with AutoHotkey and UE, Word etc.

Revil
  • Members
  • 23 posts
  • Last active: Jun 04 2013 12:55 PM
  • Joined: 12 Jan 2012
Hello,
thank you very much for your answer. I turn off Ditto clipboard manager and start testing.
I wrote this simple code:

ClipboardCopy = %ClipboardAll%
Clipboard = Test string
Sleep, 1000
MsgBox, %Clipboard%
SendInput ^v
Clipboard = %ClipboardCopy%
ClipboardCopy =

In Notepad: Show dialog "Test string" and paste "Test string".

In UEStudio v11.20.0.1006: Show dialog "Test string" and paste the old content of the clipboard. I do not understand why...

Thank you.

Revil
  • Members
  • 23 posts
  • Last active: Jun 04 2013 12:55 PM
  • Joined: 12 Jan 2012
I just found the problem!

This is the problem:
Clipboard = %ClipboardCopy%
ClipboardCopy =

Because this:
ClipboardCopy = %ClipboardAll%
Clipboard = Test string
Sleep, 1000
MsgBox, %Clipboard%
SendInput ^v
Sleep, 1000 ; Wait, wait, wait, wait, wait, wait !!!!!!!!!!!!!
Clipboard = %ClipboardCopy%
ClipboardCopy =
is working.

Clipboard = %ClipboardCopy% is restoring of the original content of the clipboard. But the restoration is made after Ctrl + v so it is weird that it is the problem.

  • Guests
  • Last active:
  • Joined: --
This should be better anyway note the lack of %%
ClipboardCopy := ClipboardAll

Clipboard := "Test string"

Sleep, 1000

MsgBox, % Clipboard

Send ^v ; you can also try various send methods

Clipboard := ClipboardCopy

ClipboardCopy =


Odlanir
  • Members
  • 775 posts
  • Last active: Mar 06 2014 11:02 AM
  • Joined: 07 Aug 2011
Have you tried all of this key-combo ?
Copy	: ^{vk43} or ^c or ^{Ins}
Paste	: ^{vk56} or ^v or +{Ins}
Cut		: ^{vk58} or ^x or +{Del}

Win7 - Firefox 10.0.2 - AHK_L 1.1.07.00
Please bear with me and my English which is so bad at times that even I don't understand myself

Revil
  • Members
  • 23 posts
  • Last active: Jun 04 2013 12:55 PM
  • Joined: 12 Jan 2012

This should be better anyway note the lack of %%


I never heard about this problem with variables. I usually prefer variables. Should I rather use expressions everywhere?

Thank you very much for you explanation.

Odlanir
  • Members
  • 775 posts
  • Last active: Mar 06 2014 11:02 AM
  • Joined: 07 Aug 2011
Perhaps I was not clear. Have you tried to paste Sending ^{vk56} or +{Ins} instead of ^v ?
Win7 - Firefox 10.0.2 - AHK_L 1.1.07.00
Please bear with me and my English which is so bad at times that even I don't understand myself

Revil
  • Members
  • 23 posts
  • Last active: Jun 04 2013 12:55 PM
  • Joined: 12 Jan 2012
I am sorry Odlanir my last post was not respond to your post.

I will try other keyboard shortcuts... Thanks.

  • Guests
  • Last active:
  • Joined: --

I never heard about this problem with variables. I usually prefer variables. Should I rather use expressions everywhere?

ClipboardAll may have binary data (rich text, images etc) so by using %ClipboardAll% it may loose some of its formatting (I think but could be wrong) Besides := is shorter to write as wrapping everything in %% ;-)

Revil
  • Members
  • 23 posts
  • Last active: Jun 04 2013 12:55 PM
  • Joined: 12 Jan 2012
So I made big testing and here are results...

I tried all combinations and all keyboard shortcuts for pasting (SendInput ^v, {vk56}, +{Ins}) and nothing worked. I tried variables and expressions with every combination and nothing worked. Then I tried Send ^v instead SendInput and it is working! And it works with variables and expressions too.

If I remember correctly SendInput buffer keyboard. Maybe this is the problem.

Thank you guys!