如何在ExtendScript中模拟按键



目前我想为AE编写一个脚本,这减轻了我的一些键盘输入。脚本运行后,我想用鼠标单击,然后模拟一些键输入,例如X、Y和Z。小GUI和事件处理程序没有问题,只是模拟按键。请帮忙。

var win = new Window ("dialog", "Dummy");
win.aButton = win.add ("button", undefined, "Start");
win.bButton = win.add ("button", undefined, "Stop");
//Start
win.aButton.onClick = function (event){
var activeViewer = app.activeViewer;
    if activeViewer.type == ViewerType.VIEWER_COMPOSITION){
     HERE SHOULD THE KEYS x, y AND z PRESSED VIA THE SCRIPT 
    }else return;
}
//Stop
win.bButton.onClick = function (event){
    win.close();
    return;
}
win.show();

扩展脚本中有一些东西看起来可以执行KeyboardEvents

Javascript工具指南查看第152页

initKeyboardEvent() eventObj.initKeyboardEvent (eventName, bubble, isCancelable, view, keyID, keyLocation, modifiersList)  

相关内容

  • 没有找到相关文章

最新更新