1. #1
    Sencha User
    Join Date
    Oct 2011
    Posts
    172
    Vote Rating
    -10
    Answers
    7
    glafrance is infamous around these parts glafrance is infamous around these parts

      0  

    Default Unanswered: me.application.addListener and detecting Ctrl+click with ctrlKey - Please help

    Unanswered: me.application.addListener and detecting Ctrl+click with ctrlKey - Please help


    I have an image control defined to fire an event as so:

    Code:
    xtype: 'image',
    id: 'brandingImg',
    listeners: {
        //The click event and handler
        afterrender: function (el) {
            el.getEl().on('click', function () {
                OMPortal.app.fireEvent('logoClickEvent');
            }, el);
        }
    }
    I then set up a listener in a controlled, and an event handler, but e.ctrlKey is undefined. Please help.

    Code:
    init: function() {
        var me = this;
    
        me.application.addListener({
            'logoClickEvent': me.onLogoClick
        });
    }
    
    onLogoClick: function (e, t, eOpts) {
        if (e.ctrlKey) {
            alert('it works');
        }
    }

  2. #2
    Sencha User
    Join Date
    Oct 2011
    Posts
    172
    Vote Rating
    -10
    Answers
    7
    glafrance is infamous around these parts glafrance is infamous around these parts

      0  

    Default


    Figured it out:

    afterrender: function (el) {
    el.getEl().on('click', function (e, t, eOpts) {
    OMPortal.app.fireEvent('logoClickEvent', e, t, eOpts);
    }, el);
    }