windows 10 pro office 2019 pro office 365 pro windows 10 home windows 10 enterprise office 2019 home and business office 2016 pro windows 10 education visio 2019 microsoft project 2019 microsoft project 2016 visio professional 2016 windows server 2012 windows server 2016 windows server 2019 Betriebssysteme office software windows server https://softhier.com/ instagram takipçi instagram beğeni instagram görüntüleme instagram otomatik beğeni facebook beğeni facebook sayfa beğenisi facebook takipçi twitter takipçi twitter beğeni twitter retweet youtube izlenme youtube abone instagram

allowedkeys in Ember.js actions for Direction keys

Asked By: Anonymous

Basically what I am trying to do is turn an array into a list of divs that can be navigated by using the up and down arrow on the keyboard. I have the keyboard events working using any of the letters on the keyboard (‘u’, ‘d’, etc) but i can’t work out how to do this with the arrow keys.

{{action 'testing' this on="keyPress" allowedKeys="d⇧f"}}

The above example will call my method testing when i press either ‘d’ or ‘f’ but does not trigger for the up arrow key.

Can anyone point me to a way to make this work with the arrow keys and esc as well? I will need to call different methods based on the different keys so i think i will need to add multiple action handler as well as the key does not get passed in as far as i know.


Solution

Answered By: Anonymous

I managed to get an answer on another forum and thought i would post a link to the answer as well as the answer here.

The post with the answer in it is http://discuss.emberjs.com/t/need-help-with-allowedkeys-on-action-for-special-keys/2960/4?u=seer

You can see the answer on jsfiddle here http://jsfiddle.net/NQKvy/304/

You basically need to handle the keypress events by extending the view but the example also includes the whole list example where the keys change the selection and move oyu up and down the list. A really great example.

This is how to handle the keypress but the jsfiddler is a more complete example

App.IndexView = Ember.View.extend({
didInsertElement: function() {
    // brings the view into focus in order to capture keyUps.
    // there are a few ways to handle this, this is just one.
    return this.$().attr({ tabindex: 1 }), this.$().focus();
},
keyDown: function(e) {
    var dir;

    if(e.keyCode === 38) dir = -1;
    else if(e.keyCode === 40) dir = 1;

    if(dir) {
        this.get('controller').send('changeSelection', { direction: dir });
    }
}

});

techinplanet staff


Windows 10 Kaufen Windows 10 Pro Office 2019 Kaufen Office 365 Lizenz Windows 10 Home Lizenz Office 2019 Home Business Kaufen windows office 365 satın al follower kaufen instagram follower kaufen porno
Alanya escort Manavgat escort Fethiye escort Kemer escort Didim escort http://www.kadinescort.net Gaziantep escort Denizli escort Adana escort Hatay escort Aydın escort İzmir escort Ankara escort Antalya escort Bursa escort İstanbul escort Kocaeli escort Konya escort Muğla escort Malatya escort Kayseri escort Mersin escort Samsun escort Sinop escort Tekirdağ escort Eskişehir escort Yalova escort Rize escort Amasya escort Balıkesir escort Çanakkale escort Bolu escort Erzincan escort Şırnak escort Van escort Yozgat escort Zonguldak escort Afyon escort Adıyaman escort Bilecik escort Aksaray escort Ağri escort Bitlis escort Siirt escort Çorum escort Burdur escort Diyarbakir escort Edirne escort Düzce escort Erzurum escort Kırklareli escort Giresun escort Kilis escort Kars escort Karabük escort Kırıkkale escort Mardin escort Kırşehir escort Maraş escort Manisa escort Muş escort Kastamonu escort Ordu escort Nevşehir escort Sakarya escort Osmaniye escort Şanliurfa escort Sivas escort Trabzon escort Tokat escort Ardahan escort Bartın escort Karaman escort Batman escort Bayburt escort Bingöl escort Elaziğ escort Gümüşhane escort Hakkari escort Isparta escort Uşak escort Igdır escort