Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using the function results in Ctrl+V functionality to be completely lost #1

Open
Gewerd-Strauss opened this issue Mar 23, 2021 · 2 comments

Comments

@Gewerd-Strauss
Copy link

Gewerd-Strauss commented Mar 23, 2021

Hello,

in search of an actually working method of pasting variables contents (because my PC decided it just doesn't want to accept code that has been working flawlessly the last six months), I've stumbled upon this function. It is neat, does what I expect and want it to do, very reliably - to be fair, my previous solution did also never not work till today, but yeah.

However, it has one problem for me that makes this function absolutely unusable for me, and I strongly suspect it to be a bug.
If I use this in any script, and execute the lines, I can no longer use Ctrl+V to paste my clipboard. It just doesn't happen. I then need to restart the script containing the used Clip()-instance, and can then use Ctrl+V again - until the next time it is triggered.
This does not happen if the section of code containing the function call is not triggered. In that case, I can happily use Ctr+V.

I took a look at the function, but couldn't find anything that immediately came to mind.
I have attached the code I am using to trigger the function. I did test it with a simple hotkey and within an autorun section, the same bug was the result

Gui, New,, Comment Creator Gui, add, Text, x025 y015, Comment will be inserted at position of triggerstring gui, add, Edit, r50 vVComment w1000 WantTab, Date: %A_DD% %A_MMMM% %A_YYYY% %A_Hour%:%A_Min%:%A_Sec%:``n gui, add, Button, gSubmitText, Insert Comment gui, show if WinActive("Comment Creator") { sleep, 20 SendInput, {End} } return #If WinActive("Comment Creator") ^Enter::ControlClick Insert Comment, Comment Creator ; AHK Studio: Comment Creator || Submit Text #If SubmitText: gui, submit gui, destroy CommentStruct=/*n%VComment%``n*/ ;fClip(CommentStruct) ;mf_PasteVar(CommentStruct) fClip(CommentStruct) return

@Gewerd-Strauss
Copy link
Author

Hello,

in search of an actually working method of pasting variables contents (because my PC decided it just doesn't want to accept code that has been working flawlessly the last six months), I've stumbled upon this function. It is neat, does what I expect and want it to do, very reliably - to be fair, my previous solution did also never not work till today, but yeah.

However, it has one problem for me that makes this function absolutely unusable for me, and I strongly suspect it to be a bug.
If I use this in any script, and execute the lines, I can no longer use Ctrl+V to paste my clipboard. It just doesn't happen. I then need to restart the script containing the used Clip()-instance, and can then use Ctrl+V again - until the next time it is triggered.
This does not happen if the section of code containing the function call is not triggered. In that case, I can happily use Ctr+V.

I took a look at the function, but couldn't find anything that immediately came to mind.
I have attached the code I am using to trigger the function. I did test it with a simple hotkey and within an autorun section, the same bug was the result

Gui, New,, Comment Creator Gui, add, Text, x025 y015, Comment will be inserted at position of triggerstring gui, add, Edit, r50 vVComment w1000 WantTab, Date: %A_DD% %A_MMMM% %A_YYYY% %A_Hour%:%A_Min%:%A_Sec%:n gui, add, Button, gSubmitText, Insert Comment gui, show if WinActive("Comment Creator") { sleep, 20 SendInput, {End} } return #If WinActive("Comment Creator") ^Enter::ControlClick Insert Comment, Comment Creator ; AHK Studio: Comment Creator || Submit Text #If SubmitText: gui, submit gui, destroy CommentStruct= /* n%VComment%n*/ ;fClip(CommentStruct) ;mf_PasteVar(CommentStruct) fClip(CommentStruct) return

@Gewerd-Strauss
Copy link
Author

I have found a way to circumvent this issue, which at least works for what I've been using this for. I do not know if it will negatively impact other functionality of the function, but here goes. In lines 29 and 31, before returning each time, I have deactivated the %A_ThisFunc%-timer again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant