开发者

How can we add keyboard shortcuts to an mx:MenuBar?

开发者 https://www.devze.com 2023-01-20 16:39 出处:网络
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\

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 mo开发者_如何学Pythonuse, but I haven't been able to implement the keyboard shortcuts.

I found a sample solution online (edit: link no longer available), 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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号