if (ev.isControlDown()) {
if ((ev.getKeyCode() & ev.getComponent().getToolkit().getMenuShortcutKeyMask()) != 0) {
    public void keyPressed(KeyEvent ev) {        // handle pseudo--menu-shortcuts        if (ev.isControlDown()) {            // for every menu accelerator...            for (Enumeration shortcuts = shortcuts(); shortcuts.hasMoreElements() ;) {                MenuShortcut shortcut = (MenuShortcut) shortcuts.nextElement();                // is this keyPress the same as a menu accelerator?                if ((shortcut.getKey() == ev.getKeyCode()) && (shortcut.usesShiftModifier() == ev.isShiftDown()) ) {                    // fire off the menu action event if the menu is active                    if (getShortcutMenuItem(shortcut).isEnabled()) {                        actionPerformed( new ActionEvent(this,1,getShortcutMenuItem(shortcut).getActionCommand()) );                    }                }            }        }    }