setmenuaccel
Sets an accelerator for the given action in the Compose user interface. setmenuaccel is only available in the Compose GUI.
Syntax
setmenuaccel(uiAction, accel, context)
Inputs
- uiAction
- The handle of the action.
- accel
- The shortcut key for the action.
- context
- An optional shortcut context of the action. The context can be widget-specific or apply to the entire application.
Examples
Set an accelerator for the given
action:
pm=addribbonmenu('Test'); % create a 'Test' ribbon page as menu
ab = addmenuitem(pm,'Show Test Label','Show Test','HandleTest','','');
setmenuaccel(ab, 'CTRL+T');
ac = addmenuitem('Test','Show Test Label 1', 'Show Test 1','HandleTest_1','','');
function HandleTest()
disp('Comment is handled');
end
function HandleTest_1()
disp('Comment is handled');
end