Clipboard not work properly with ^v
Posted: 01 Jan 2018, 03:04
TEST SCRIPT:
Clipboard works great if the content for clipboard is short, but if you try to increase Loop,1 to Loop,10 OR Loop,100
and press +F12 rapidly, look at the content you just paste out, it randomly paste with same string but uppercase.
'oooooOOOO'
I try to solve this issue by myself.
I did try
(1). NOT WORK with ClipWait
Using ClipWait to force the script paste until the clipboard is not empty.
(2). NOT WORK with string checking.
Using while loop to make a case-sensitive condition.
(3). WORK but STUPID with Sleep.
Put a Increased Sleep depend on the foo's length with the Clipboard binding statement.
Yes the case 3 can solve this problem, but it's awful solution.
Can someone please help me out![Hit my head against the wall. :headwall:](./images/smilies/headwall.gif)
Code: Select all
global foo := ""
Loop,1
foo.="o"
return
+F12::
QPC(1)
Send %foo%
TEST1 := QPC(0)
QPC(1)
tmp := Clipboard
, Clipboard := foo
SendPlay ^v
TEST2 := QPC(0)
Tooltip % TEST1 "`n" TEST2
return
QPC(R := 0) {
static P := 0, F := 0, Q := DllCall("QueryPerformanceFrequency", "Int64*", F)
return !DllCall("QueryPerformanceCounter", "Int64*", Q) + (R ? (P := Q) / F : (Q - P) / F)
}
and press +F12 rapidly, look at the content you just paste out, it randomly paste with same string but uppercase.
'oooooOOOO'
I try to solve this issue by myself.
I did try
(1). NOT WORK with ClipWait
Using ClipWait to force the script paste until the clipboard is not empty.
Code: Select all
tmp := Clipboard
, Clipboard := "" ; NOTE: This line is for ClipWait
, Clipboard := foo
ClipWait,4
SendPlay ^v
Using while loop to make a case-sensitive condition.
Code: Select all
tmp := Clipboard
, Clipboard := foo
while (Clipboard != foo)
{}
SendPlay ^v
Put a Increased Sleep depend on the foo's length with the Clipboard binding statement.
Code: Select all
tmp := Clipboard
, Clipboard := foo
Sleep 8 * StrLen(StrLen(foo))
SendPlay ^v
Can someone please help me out
![Hit my head against the wall. :headwall:](./images/smilies/headwall.gif)