You are not makng any sense. Do you want to copy some text from for example this website and into the processing environment(/text editor)? If that is what you mean, the answer is yes.
Or do you mean into a sketch you've made? In which case you have to check for whether the user presses some keys.
It is not clear what the OP wants but G4P supports copy and paste into the running sketch.
In this example sketch below click on the text area and press Ctrl + V to paste any text on the clipboard into the area. (You need to copy some text from elsewhere first obviously :D )
You will need to install G4P using the Contributions Manager for this sketch to run.
import g4p_controls.*;
GTextArea txaArea;
public void setup(){
size(320, 200, P2D);
surface.setTitle("Paste from clipboard example");
txaArea = new GTextArea(this, 10, 10, 300, 180, G4P.SCROLLBARS_BOTH | G4P.SCROLLBARS_AUTOHIDE);
txaArea.setPromptText("Use Ctrl + V to paste some text here");
txaArea.setOpaque(true);
}
public void draw(){
background(230);
}
Answers
Do you mean the editor?
No i mean a text from keyboard..
Hello,
here you can get text data from the Win 10 clipboard inside your running sketch (you paste into the variable
a1
)use space bar for ctrl-v (does run in P2D, not in P3D afaik)
Chrisir
You are not makng any sense. Do you want to copy some text from for example this website and into the processing environment(/text editor)? If that is what you mean, the answer is yes.
Or do you mean into a sketch you've made? In which case you have to check for whether the user presses some keys.
It is not clear what the OP wants but G4P supports copy and paste into the running sketch.
In this example sketch below click on the text area and press Ctrl + V to paste any text on the clipboard into the area. (You need to copy some text from elsewhere first obviously :D )
You will need to install G4P using the Contributions Manager for this sketch to run.
Relevant links:
https://forum.processing.org/two/discussions/tagged/clipboard
https://forum.processing.org/one/topic/copy-and-paste.html
https://forum.processing.org/one/topic/what-is-the-simplest-way-to-copy-to-the-clipboard-from-processing.html
Kf