Changeset 12748 in josm for trunk/src/org/openstreetmap/josm/tools
- Timestamp:
- 2017-09-06T01:08:48+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/PlatformHook.java
r12695 r12748 3 3 4 4 import java.awt.GraphicsEnvironment; 5 import java.awt.Toolkit; 6 import java.awt.event.KeyEvent; 5 7 import java.io.BufferedReader; 6 8 import java.io.File; … … 242 244 243 245 /** 246 * Returns extended modifier key used as the appropriate accelerator key for menu shortcuts. 247 * It is advised everywhere to use {@link Toolkit#getMenuShortcutKeyMask()} to get the cross-platform modifier, but: 248 * <ul> 249 * <li>it returns KeyEvent.CTRL_MASK instead of KeyEvent.CTRL_DOWN_MASK. We used the extended 250 * modifier for years, and Oracle recommends to use it instead, so it's best to keep it</li> 251 * <li>the method throws a HeadlessException ! So we would need to handle it for unit tests anyway</li> 252 * </ul> 253 * @return extended modifier key used as the appropriate accelerator key for menu shortcuts 254 * @since 12748 (as a replacement to {@code GuiHelper.getMenuShortcutKeyMaskEx()}) 255 */ 256 default int getMenuShortcutKeyMaskEx() { 257 return KeyEvent.CTRL_DOWN_MASK; 258 } 259 260 /** 244 261 * Called when an outdated version of Java is detected at startup. 245 262 * @since 12270 -
trunk/src/org/openstreetmap/josm/tools/PlatformHookOsx.java
r12697 r12748 76 76 } 77 77 checkExpiredJava(callback); 78 } 79 80 @Override 81 public int getMenuShortcutKeyMaskEx() { 82 return KeyEvent.META_DOWN_MASK; 78 83 } 79 84 -
trunk/src/org/openstreetmap/josm/tools/Shortcut.java
r12620 r12748 23 23 24 24 import org.openstreetmap.josm.Main; 25 import org.openstreetmap.josm.gui.util.GuiHelper;26 25 27 26 /** … … 370 369 if (initdone) return; 371 370 initdone = true; 372 int commandDownMask = GuiHelper.getMenuShortcutKeyMaskEx();371 int commandDownMask = Main.platform.getMenuShortcutKeyMaskEx(); 373 372 groups.put(NONE, -1); 374 373 groups.put(MNEMONIC, KeyEvent.ALT_DOWN_MASK);
Note:
See TracChangeset
for help on using the changeset viewer.