1. #1
    Sencha User
    Join Date
    Dec 2010
    Posts
    6
    Vote Rating
    0
    orgreeno is on a distinguished road

      0  

    Default Global keypress

    Global keypress


    Using Designer 2, what is the best way to listen for a keypress event for the entire app? Can I add a keypress listener to the main panel? Or listen for keypress DOM events?

  2. #2
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,188
    Vote Rating
    119
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    Probably subscribing to the key event on the body.
    eg
    Ext.getBody().on

    You could set this up in your Application launch method.
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  3. #3
    Sencha User
    Join Date
    Dec 2010
    Posts
    6
    Vote Rating
    0
    orgreeno is on a distinguished road

      0  

    Default


    Should this fire the alert?
    launch: function() {
    alert("launched");
    Ext.create('MyApp.view.main_panel', {fullscreen: true});
    }
    The app loads but the alert does not fire.

    build 355
    sencha touch project

  4. #4
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,188
    Vote Rating
    119
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    It should. I just tested a simple application by doing the following:

    Start a touch 2.0 project
    Drag out a Panel
    Add a launch method to Application
    add an alert to the launch method

    Save and preview the project in the browser.

    the code generated for Application was:
    Code:
    Ext.Loader.setConfig({
        enabled: true
    });
    
    Ext.application({
        views: [
            'MyPanel'
        ],
        name: 'MyApp',
    
        launch: function() {
            alert('launch');
            Ext.create('MyApp.view.MyPanel', {fullscreen: true});
        }
    
    });
    Aaron Conran
    @aconran
    Sencha Architect Development Team

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi