Keyboard Shortcut for the Listing of Submenu Items in Main Menu - Matlab GUI

6 ビュー (過去 30 日間)
Kanchibhotla Chandra Sekhar
Kanchibhotla Chandra Sekhar 2014 年 9 月 8 日
編集済み: Image Analyst 2014 年 9 月 9 日
I created the Menu for my Matlab GUI which is "File" under which sub menus are Open, Save & Exit. When i clicked on the File Menu, it will list down the sub menu items Open, Save & Exit.
I want to assign a shortcut key for this file menu instead of clicking the file menu when i press the "Alt+F" it has the show the list down of sub menu items.I don't want to use the shortcut option provided by the Guide, i want to hard code that shortcut Key.
I have coded for the combination of the key detection (Alt+F) but which function/call back has to be used for the listing down of the sub menu items ?

回答 (1 件)

Image Analyst
Image Analyst 2014 年 9 月 9 日
Not sure what difficulties you're facing, but each menu item, no matter where it is in the hierarchy of menus and submenus, can be assigned a shortcut keystroke combination. So for example if you want File->Open to be control-O, you can specify that in the menu editor within GUIDE.
  2 件のコメント
Kanchibhotla Chandra Sekhar
Kanchibhotla Chandra Sekhar 2014 年 9 月 9 日
Its just like in Microsoft Word when we press Alt+F shortcut Key, we will get list of items in File Menu to select. Similarly when i press the Alt+F in my GUI, it has to show the list of the submenu items under File Menu.
As Shown in Image Below, i when click on File Menu, it will show the items in File Menu, same option i want to get by shortcut Key Alt+F
Image Analyst
Image Analyst 2014 年 9 月 9 日
編集済み: Image Analyst 2014 年 9 月 9 日
MATLAB is a cross platform app and unfortunately for us Windows users doesn't seem to follow all the conventions, like typing Enter to take the default button. I think it follows Java conventions more than Windows. If it doesn't respond to alt-F then you may just be a victim of differences between Java and Windows.
By the way, on my Windows 7 computer if you type Alt then down arrow (one after the other), the File menu drops down.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeEnvironment and Settings についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by