Keyboard commands
Hi all!
Im looking for a way for MAX to send keyboard commands
i.e. when a message is banged it will "press" the Ctrl key.
(Like the opposite of the Key object...)
Is this possible?
Any help would be well received!
What are you trying to send the key down/up command to do?
Ctrl + E to auto lock patch
You could do this with menu commands using applescript and the [shell] external (you can find it in the toolbox pages) or alternatively you could use the autobot java class (search the forum, it's been linked to quite a bit) and probably the most simple method: you could use the locked property of the patcher object in javascript using the [js] object.
Thanks Luke,
I have never used Javascript! but I suppose now is as good a time to learn...
I'll save you the work, here's a little abstraction I use for the same thing, with a helpfile too:
// lh.editmode.js
function bang() {
outlet(0,this.patcher.locked);
}
function lock(x) {
this.patcher.locked = x;
bang();
}
function anything() {
post("lh.editmode.js: doesn't understand ""+messagename+""n");
}
autowatch = 1;
// EOF
Thank you that is so helpfull!
Do you have any other basic/intros to Java script?