flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kinjal patel <kinjalpatel3...@gmail.com>
Subject NativeMenuItem keyModifier with function key (AIR)
Date Mon, 08 Feb 2016 12:52:18 GMT
Hello,

I have a native menu item with a shortcut for a simple letter like "F".

<fx:Declarations>
		<fx:XML format="e4x" id="menuData"> 
			<root> 
				<menuitem label="File"> 
					<menuitem label="New" keyEquivalent="f6" controlKey="false"/> 
					<menuitem label="Open" keyEquivalent="o" controlKey="true"/> 
					<menuitem label="Save" keyEquivalent="s" controlKey="true"/> 
					<menuitem label="Save As..."  
							  keyEquivalent="s"  
							  controlKey="true"  
							  shiftKey="true"/> 
					<menuitem label="Close" keyEquivalent="w" controlKey="true"/> 
				</menuitem> 
				<menuitem label="Edit"> 
					<menuitem label="Cut" keyEquivalent="x" controlKey="true"/> 
					<menuitem label="Copy" keyEquivalent="c" controlKey="true"/> 
					<menuitem label="Paste" keyEquivalent="v" controlKey="true"/> 
				</menuitem> 
			</root> 
		</fx:XML> 
<s:menu>
		<mx:FlexNativeMenu dataProvider="{menuData}"  
						   labelField="@label"  
						   keyEquivalentField="@keyEquivalent"  
						   keyEquivalentModifiersFunction="keyEquivalentModifiers"  
						   showRoot="false"  
						   itemClick="trace('click:', event.label);"/> 
		
	</s:menu>
	<s:VGroup>
		<s:Label text="Enter Some Test Here" />
		<s:TextArea height="100" width="100"
keyDown="textarea1_keyDownHandler(event)" />
	</s:VGroup>

	
I have a native menu item with a shortcut for a simple letter like "F".

<s:menu> 
    <mx:FlexNativeMenu id="mainMenu"
                       dataProvider="{menuData}"  
                       labelField="@label"  
                       keyEquivalentField="@keyEquivalent"  
                       showRoot="false" /> 
</s:menu> 

<fx:Declarations>
    <fx:XML format="e4x" id="menuData"> 
        <root> 
            <menuitem label="Edit"> 
                <menuitem label="Frame Selection" keyEquivalent="f"/>
            </menuitem> 
        </root> 
    </fx:XML>
</fx:Declarations>
This works great, but when I try to type text in any textfield or textInput
anywhere in the app,
 I cant ever type f.

How can stop the menu from stealing my keyboard input ?



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/NativeMenuItem-keyModifier-with-function-key-AIR-tp11950.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Mime
View raw message