Convert from keyboard keys to a function
in
Programming Questions
•
7 months ago
Hi... i have some experience with processing, it is great!!...but i am trying to develop a program in witch you can call some function and simply program a robot, for learning reason at school.
I have many ideas but i was wondering if processing have a function to convert a string into a function that exists in the sketch and have some variables.
example:
string function = "";
void keyPressed(){
if (key == !ENTER) function += key ; // example type move(10, 30); or something else
if (key == ENTER) // call some kind a function to convert move(10, 30); from string into a function that exists in the sketch
convert.function(function); // execute the function move(int x, int y);
}
void move(int x, int y) {
// some code inside
}
1