PDA

View Full Version : [SOLVED]disable F8 F9--> keycode



andryi
7 Aug 2009, 7:52 AM
Hi guys, I've got a problem, you'll see:



new Ext.KeyMap(Ext.getDoc(), {

key: [113,119,120],
// key: [F2,F8,F9],
alt: true,
// F2:true,
// F8:true,
// F9:true,
handler: function(k, e) {
// var key = this.keyCode;
var t = Ext.getCmp('tabpanel');
switch(k) {
case 113:
t.setActiveTab(0);
break;
case 119:
t.setActiveTab(1);
break;
case 120:
t.setActiveTab(2);
break;
}
},
stopEvent: true
});
can you help, because when I push F2 or F8 or F9, not happens nothing, what's wrong?(:|

andryi
7 Aug 2009, 8:10 AM
Well, I did it=D>
here is my code, if someone needs



document.onkeypress = keyPress;

function keyPress(ev)
{
ev || (ev = window.event);
var code = (ev.keyCode ? ev.keyCode: (ev.charCode ? ev.charCode: ev.which));
var t = Ext.getCmp('tabpanel');
switch(code) {
case 113:
t.setActiveTab(0);
break;
case 119:
t.setActiveTab(1);
break;
case 120:
t.setActiveTab(2);
break;
}
}