What I want to achieve is to set a handler/function to an Enter event, but in my case there's two different functions I want to invoke so my plan is to set the other Enter event to have a ctrl:true
config/property. But it doesn't work, the only thing that works is whoever is the last one declared (since this is how compiler reads the code [top to bottom]).
Below is a brief preview of my code:
Ext.define('mynamespace'{
extend: 'Ext.window.Window',
alias: 'widget.myalias',
requires: [ //all my requires here]
modal: true,
keyMapEnabled:true,
keyMap: {
Enter: { //this works if I don't have the keyMap after this
handler: 'myfunction'
},
Enter: { //this is the one that only works since this is the last event that is initialized after the screen/window is rendered/loaded
handler: 'myhandler',
ctrlKey: true
}
}
});
I tried the ones on https://docs.sencha.com/extjs/6.5.1/modern/Ext.mixin.Keyboard.html#method-getKeyMap, but it didn't worked on my part.
This is the one that worked for me: https://fiddle.sencha.com/#view/editor&fiddle/1tre