This is how I usually do it in ExtJS applications (the last case example), it seems to work well for me:
// attach key navigation to document Ext.getDoc().on('keypress', function(event, target) { if (event.ctrlKey && !event.shiftKey) { event.stopEvent(); switch(event.getKey()) { case event.LEFT : this.shiftTabs(-1); break; case event.RIGHT : this.shiftTabs(1); break; case event.DELETE : this.closeActiveTab(); break; case event.F4 : // this is actually the "S" key this.saveAll(); // handler break; // other cases... } } });
source share