1050 /**
1051 * Determines which modifier key is the appropriate accelerator
1052 * key for menu shortcuts.
1053 * <p>
1054 * Menu shortcuts, which are embodied in the
1055 * {@code MenuShortcut} class, are handled by the
1056 * {@code MenuBar} class.
1057 * <p>
1058 * By default, this method returns {@code Event.CTRL_MASK}.
1059 * Toolkit implementations should override this method if the
1060 * <b>Control</b> key isn't the correct key for accelerators.
1061 * @return the modifier mask on the {@code Event} class
1062 * that is used for menu shortcuts on this toolkit.
1063 * @exception HeadlessException if GraphicsEnvironment.isHeadless()
1064 * returns true
1065 * @see java.awt.GraphicsEnvironment#isHeadless
1066 * @see java.awt.MenuBar
1067 * @see java.awt.MenuShortcut
1068 * @since 1.1
1069 */
1070 public int getMenuShortcutKeyMask() throws HeadlessException {
1071 GraphicsEnvironment.checkHeadless();
1072
1073 return Event.CTRL_MASK;
1074 }
1075
1076 /**
1077 * Returns whether the given locking key on the keyboard is currently in
1078 * its "on" state.
1079 * Valid key codes are
1080 * {@link java.awt.event.KeyEvent#VK_CAPS_LOCK VK_CAPS_LOCK},
1081 * {@link java.awt.event.KeyEvent#VK_NUM_LOCK VK_NUM_LOCK},
1082 * {@link java.awt.event.KeyEvent#VK_SCROLL_LOCK VK_SCROLL_LOCK}, and
1083 * {@link java.awt.event.KeyEvent#VK_KANA_LOCK VK_KANA_LOCK}.
1084 *
1085 * @param keyCode the key code
1086 * @return {@code true} if the given key is currently in its "on" state;
1087 * otherwise {@code false}
1088 * @exception java.lang.IllegalArgumentException if {@code keyCode}
1089 * is not one of the valid key codes
|
1050 /**
1051 * Determines which modifier key is the appropriate accelerator
1052 * key for menu shortcuts.
1053 * <p>
1054 * Menu shortcuts, which are embodied in the
1055 * {@code MenuShortcut} class, are handled by the
1056 * {@code MenuBar} class.
1057 * <p>
1058 * By default, this method returns {@code Event.CTRL_MASK}.
1059 * Toolkit implementations should override this method if the
1060 * <b>Control</b> key isn't the correct key for accelerators.
1061 * @return the modifier mask on the {@code Event} class
1062 * that is used for menu shortcuts on this toolkit.
1063 * @exception HeadlessException if GraphicsEnvironment.isHeadless()
1064 * returns true
1065 * @see java.awt.GraphicsEnvironment#isHeadless
1066 * @see java.awt.MenuBar
1067 * @see java.awt.MenuShortcut
1068 * @since 1.1
1069 */
1070 @SuppressWarnings("deprecation")
1071 public int getMenuShortcutKeyMask() throws HeadlessException {
1072 GraphicsEnvironment.checkHeadless();
1073
1074 return Event.CTRL_MASK;
1075 }
1076
1077 /**
1078 * Returns whether the given locking key on the keyboard is currently in
1079 * its "on" state.
1080 * Valid key codes are
1081 * {@link java.awt.event.KeyEvent#VK_CAPS_LOCK VK_CAPS_LOCK},
1082 * {@link java.awt.event.KeyEvent#VK_NUM_LOCK VK_NUM_LOCK},
1083 * {@link java.awt.event.KeyEvent#VK_SCROLL_LOCK VK_SCROLL_LOCK}, and
1084 * {@link java.awt.event.KeyEvent#VK_KANA_LOCK VK_KANA_LOCK}.
1085 *
1086 * @param keyCode the key code
1087 * @return {@code true} if the given key is currently in its "on" state;
1088 * otherwise {@code false}
1089 * @exception java.lang.IllegalArgumentException if {@code keyCode}
1090 * is not one of the valid key codes
|