can i connect keystrokes directly to functions?
Hi Experts, i wonder if i can connect keystrokes directly to functions instead of double click or (run) the script everytime with UI , i mean can i run script once and call the functions via keystrokes instead of showing Script UI that need to be Active to respond? and thanks in advance
#targetengine "mysession";
var w = new Window("palette", {independent:true});
w.orientation = "stack"
w.alignment = "center"
var edit = w.add ("edittext")
edit.visible = false
edit.active = true;
w.text = "Send KeyStrokes to Execute Functions"
w.preferredSize.width = 200;
w.alignChildren = ["left", "top"];
w.orientation = "row";
w.spacing = 5;
w.margins = 16
w.add ("statictext", undefined,"Send KeyStrokes to Execute Functions");
w.show();
w.addEventListener ("keydown", function keyPressed(key){
switch (key.keyName) {
case "U":
PressU();
case "V":
PressV();
case "H":
PressH();
case "M":
PressM();
case "Escape":
w.close()
}
})