Results 1 to 2 of 2

Thread: Key navigation, event for window on press Enter on keyboard

  1. #1
    Sencha User
    Join Date
    Dec 2013
    Posts
    65
    Answers
    2

    Default Answered: Key navigation, event for window on press Enter on keyboard

    Hello i am want make event on press key 'Enter' anywhere on the window on keyboard. I am do this:

    PHP Code:
    listeners: {
        
    afterRender: function (thisForm
    options) {       
    this.keyMap Ext.create(
                
    'Ext.util.KeyMap',            
    this.el,           
     [                {                   
     
    key13,                   
     
    fnthis.submitOnEnter,                    
    scopethis              
     
    }          
      ]     
       );  
      }},
    submitOnEnter: function (e) {  
      if (
    === 13) {      
      
    console.log('some event there!!!')  
      } }, 
    but when i click 'enter' nothing happens.

  2. I've mocked up a fiddle to demo the KeyMap listener on a window.

    Set focus to the window (click on it) then press the ENTER key. You should see an alert pop up.

    Thanks,
    Brian


  3. #2
    Sencha Premium User lumberjack's Avatar
    Join Date
    Nov 2014
    Location
    Kansas
    Posts
    781
    Answers
    102

    Default

    I've mocked up a fiddle to demo the KeyMap listener on a window.

    Set focus to the window (click on it) then press the ENTER key. You should see an alert pop up.

    Thanks,
    Brian


Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •