GUI: typing on the keyboard via Code

Hello. Simple question: how can I simulate typing on the keyboard via Code?

Sthg like:

w=Window.new.front;
w.view.keyDownAction = {arg ...args; args.postln};
{1.wait; w.view.typeViaCode(Char.space)}.fork;
... and after 1sec -> args.postln

thks for help

I don’t think there exists a programmatic hook for this.

You can call view.keyDown and view.keyUp but you need to know all the args (which I guess is not what you want).

hjh

1 Like