views:

18

answers:

1

I need some assistance from the Flex experts.

I have an mx:Menubar, which I need to be able to open/expand based on the key pressed. For e.g., if shift-R is pressed, it needs to open the 'Request' topmenu. Then if shift-N is pressed, it should load the 'New request' module in the module loader. I've already implemented the MenuBar/module-loading functionality with the mouse, but I haven't been able to implement the keyboard shortcuts.

I found a nice sample at http://www.rphelan.com/2008/03/17/flex-menu-accelerators/

However, the solution directly performs the action (e.g. shift-N to load the 'New request' module). The menu does not open/expand when you press the shortcut as though you had hovered your mouse over it (e.g. shift-R to open/expand the 'Request' topmenu and then shift-N to load the 'New request' module).

Has anyone attempted something like this?

Thanks!

+1  A: 

Are you using onShow as the event handler for the shortcut , and in the handler just have it enable each menu item not perform it so it would look like

menuBar.menuitems.(@label=="fileTab")

this should ensure that you are only selecting the items and not performing their function.

Chris
+1 Thanks, Chris! I will see if this works.
HappyCoder4U