7 Replies Latest reply on May 29, 2017 1:23 PM by pixxxel schubser

    How to press the apply button through the "enter" key on the keyboard?

    Ps-Design Level 1

      Hi everyone, how do I press the apply button through the "enter" key on the keyboard?

      I know that for this to happen, the button will first have to be selected by a blue border. As shown in picture B of the figure below. Thank you.

      Screenshot_1.jpg

      var dlg = new Window ("dialog", "My dialog", [0,0,0,0])  
      dlg.size = [200,100]  
      dlg.location = [600,260]   
      
      
      var dlgborda = dlg.add('panel', [10,5,190,80], '');
      
      
      var b1 = dlgborda.add("button", [0,0,0,0], "Cancela")  
             b1.location = [10, 12]  
             b1.size = [70, 25]
      
      
      var b2 = dlgborda.add("button", [0,0,0,0], "Apply")  
      b2.location = [90,12]  
      b2.size = [70, 25]   
      
      
      b1.onClick = function(){ 
      dlg.close()
      }
      
      
      b2.onClick = function(){ 
      dlg.close()
      tp();  
      }  
      
      
      dlg.show()  
      
      
      function tp(){  
        alert("To apply")  
      }