Shortcut keys

Quick access shortcut keys using letters and/or numbers can be added to menu items with setAlphabeticShortcut(char) (to set char shortcut), setNumericShortcut(int) (to set numeric shortcut), or setShortcut(char,int) (to set both). Case is not sensitive. For example:

menu.add(0, MENU_QUIT, 0, "Quit") .setAlphabeticShortcut('q');

Now, when the menu is open (or while holding the MENU key), pressing the "q" key will select this item.

This shortcut key will be displayed as a tip in the menu item, below the menu item name (except for items in the Icon Menu).

Note: Shortcuts cannot be added to items in a Context Menu.

0 0

Post a comment