1. #1
    Sencha User makana's Avatar
    Join Date
    Apr 2008
    Location
    Dresden, Germany
    Posts
    527
    Vote Rating
    20
    makana has a spectacular aura about makana has a spectacular aura about

      0  

    Default Possible to prevent default behaviour of ALT key?

    Possible to prevent default behaviour of ALT key?


    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
    Attached Images
    Programming today is a race between software engineers striving to build bigger and better іdiot-proof programs, and the universe striving to produce bigger and better idiots. So far, the universe is winning. (Rick Cook)

    Enhanced ExtJS adapter for Adobe AIR

  2. #2
    Sencha User makana's Avatar
    Join Date
    Apr 2008
    Location
    Dresden, Germany
    Posts
    527
    Vote Rating
    20
    makana has a spectacular aura about makana has a spectacular aura about

      0  

    Default


    Does anybody have any ideas? I don't want to bar users from doing something but implement a common known behaviour. Is it even possible to take priority with the alt key (ctrl, too or similar keys in general) over the browser/adobe air?

    Thanks for any hints or ideas!
    Programming today is a race between software engineers striving to build bigger and better іdiot-proof programs, and the universe striving to produce bigger and better idiots. So far, the universe is winning. (Rick Cook)

    Enhanced ExtJS adapter for Adobe AIR