Something I discovered a while back while working with text entry boxes - pasting text into a text entry box using keyboard Ctrl-V doesn’t work. It gives an error saying there is no text on the clipboard (even though there is and will paste elsewhere). OnTextEntryCompletion() only accepts a paste input via right-click-paste using a mouse.
I have tried to dig in and figure out why with no success. What is controlling this unexpected/atypical behavior? Can it be changed or is it intentional to avoid some key command issue somewhere?
I have tried again to debug this but am not finding the cause. Why does “right-click-paste” via mouse work but not “Ctrl-V” from keyboard?
Here is what I have found:
-
Right-click-paste fills the textbox with the copied text but then awaits being entered with the Enter key to take effect - and it works.
-
When attempting to use Ctrl-V to paste it appears to immediately apply “Enter” before the text itself is copied in via the SetStr(str) function - thereby loading blank text. But why?
Ctrl-V is standard “paste from clipboard” on both Mac and Windows but it doesn’t work here. Any ideas why not/how to fix?
Unfortunately (although I think we can probably improve this) many plug-in hosts block key presses (there is some more discussion of this here).
Have you tried using the “IGraphics Text Entry control”? This is a text entry control that is drawn by IGraphics rather than a platform native text entry. You can add one like this. It might offer nicer behavior w.r.t ctrl-V, since it uses e.g. VST3’s keypress events. In addition it draws text that matches the text drawn in the IGraphics context.
1 Like
Yes, after more checking you are correct - it is DAW-specific. Ctrl-V works in Ableton, FL Studio, Cubase and Pro Tools but - to my surprise - not in Reaper (my go-to test DAW!). Will study the link you posted as it appears to contain the same issue.
No I haven’t but will take a look. Thank you for the suggestion.