Changeset 12526 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2017-07-27T19:08:53+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/actions/mapmode
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java
r12517 r12526 142 142 } 143 143 144 updateKeyModifiers(e .getModifiers());144 updateKeyModifiers(e); 145 145 146 146 Command c; … … 295 295 Main.map.mapView.requestFocus(); 296 296 297 Command c = buildDeleteCommands(e, e.getModifiers(), false); 297 Command c = buildDeleteCommands(e, e.getModifiersEx(), false); 298 298 if (c != null) { 299 299 Main.main.undoRedo.add(c); -
trunk/src/org/openstreetmap/josm/actions/mapmode/MapMode.java
r12518 r12526 150 150 } 151 151 152 /** 153 * Update internal ctrl, alt, shift mask from given input event. 154 * @param e input event 155 */ 152 156 protected void updateKeyModifiers(InputEvent e) { 153 157 updateKeyModifiersEx(e.getModifiersEx()); 154 158 } 155 159 160 /** 161 * Update internal ctrl, alt, shift mask from given mouse event. 162 * @param e mouse event 163 */ 156 164 protected void updateKeyModifiers(MouseEvent e) { 157 165 updateKeyModifiersEx(e.getModifiersEx()); 166 } 167 168 /** 169 * Update internal ctrl, alt, shift mask from given action event. 170 * @param e action event 171 * @since 12526 172 */ 173 protected void updateKeyModifiers(ActionEvent e) { 174 // ActionEvent does not have a getModifiersEx() method like other events :( 175 updateKeyModifiersEx(mapOldModifiers(e.getModifiers())); 158 176 } 159 177 … … 181 199 } 182 200 201 /** 202 * Map old (pre jdk 1.4) modifiers to extended modifiers (only for Ctrl, Alt, Shift). 203 * @param modifiers old modifiers 204 * @return extended modifiers 205 */ 206 @SuppressWarnings("deprecation") 207 private static int mapOldModifiers(int modifiers) { 208 if ((modifiers & InputEvent.CTRL_MASK) != 0) { 209 modifiers |= InputEvent.CTRL_DOWN_MASK; 210 } 211 if ((modifiers & InputEvent.ALT_MASK) != 0) { 212 modifiers |= InputEvent.ALT_DOWN_MASK; 213 } 214 if ((modifiers & InputEvent.ALT_GRAPH_MASK) != 0) { 215 modifiers |= InputEvent.ALT_GRAPH_DOWN_MASK; 216 } 217 if ((modifiers & InputEvent.SHIFT_MASK) != 0) { 218 modifiers |= InputEvent.SHIFT_DOWN_MASK; 219 } 220 221 return modifiers; 222 } 223 183 224 protected void requestFocusInMapView() { 184 225 if (isEnabled()) {
Note:
See TracChangeset
for help on using the changeset viewer.