< prev index next >
src/java.desktop/share/classes/java/awt/MenuBar.java
Print this page
@@ -375,21 +375,20 @@
* Post an ACTION_EVENT to the target of the MenuPeer
* associated with the specified keyboard event (on
* keydown). Returns true if there is an associated
* keyboard event.
*/
- @SuppressWarnings("deprecation")
boolean handleShortcut(KeyEvent e) {
// Is it a key event?
int id = e.getID();
if (id != KeyEvent.KEY_PRESSED && id != KeyEvent.KEY_RELEASED) {
return false;
}
// Is the accelerator modifier key pressed?
- int accelKey = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
- if ((e.getModifiers() & accelKey) == 0) {
+ int accelKey = Toolkit.getDefaultToolkit().getMenuShortcutKeyMaskEx();
+ if ((e.getModifiersEx() & accelKey) == 0) {
return false;
}
// Pass MenuShortcut on to child menus.
int nmenus = getMenuCount();
< prev index next >