【Photoshop JS脚本】按键检测

// DIALOG  
// ======  
 dialog = new Window("dialog");   
    dialog.text = "按键检测";   
    dialog.orientation = "column";   
    dialog.alignChildren = ["center","top"];   
    dialog.spacing = 10;   
    dialog.margins = 16;   
  
  
    statictext1 = dialog.add("statictext");   
    statictext1.text = "编辑框输入按键值";   
    
   TEST_NUMBER = dialog.add("edittext");   
    TEST_NUMBER.text = "";   
  
  
 TEST_NUMBER.addEventListener ('keydown', KeyboardHandler);  
  dialog.show();  
  
  function KeyboardHandler (event) {  
  
  
    try {  
  
   statictext1.text =event.keyName ;
  // alert(event.keyName )
    }  
    catch (e) {  
        ;  
    }  
}  
  

猜你喜欢

转载自blog.csdn.net/greless/article/details/105975027