Hey guys!
Everybody knows, if you press ALT key on your keyboard, you activate the keyboard navigation through the main window menu (File, Edit, View etc.). That's what I want to realize for my custom main menu (a top toolbar in my Ext.air.Window).
I defined a KeyMap like this:
Code:
new Ext.KeyMap(Ext.getDoc(), {
key: Ext.EventObject.ALT,
alt: true,
stopEvent: true,
handler: function(k, e) {
if (mainMenuKeyMap.isEnabled()) {
activeBtn.onMouseOut(e);
mainMenuKeyMap.disable();
} else {
activeBtn = mainMenu.get(0);
activeBtn.onMouseOver(e);
mainMenuKeyMap.enable();
}
}
});
Where mainMenuKeyMap is another KeyMap for the navigation through the menu.
It works as far as the first button in the main menu changes its style to a mouseover style. But it hasn't got the focus. If I press the down button now, the default window's menu appears like in the screenshot.
It works like expected, if I press the alt key twice. The same when finishing the keyboard navigation.
Does anybody know, how to prevent the default bevahiour of the ALT key? I don't want to have the default window's menu.
Thanks in advance!
makana