# NetBeans IDE HG Patch # This patch file was generated by NetBeans IDE # Following Index: paths are relative to: D:\ws\core-main # This patch can be applied using context Tools: Patch action on respective folder. # It uses platform neutral UTF-8 encoding and \n newlines. # Above lines and this line are ignored by the patching process. Index: editor.lib2/src/org/netbeans/api/editor/caret/EditorCaret.java --- editor.lib2/src/org/netbeans/api/editor/caret/EditorCaret.java +++ editor.lib2/src/org/netbeans/api/editor/caret/EditorCaret.java @@ -2676,7 +2676,7 @@ c.requestFocus(); } c.setDragEnabled(true); - if (evt.isControlDown() && evt.isShiftDown()) { + if (isControlShiftDown(evt)) { mouseState = MouseState.CHAR_SELECTION; try { Position pos = doc.createPosition(offset); @@ -2711,7 +2711,7 @@ foldExpanded = caretFoldExpander.checkExpandFold(c, evt.getPoint()); } if (!foldExpanded) { - if (evt.isControlDown() && evt.isShiftDown()) { + if (isControlShiftDown(evt)) { try { int begOffs = Utilities.getWordStart(c, offset); int endOffs = Utilities.getWordEnd(c, offset); @@ -2746,7 +2746,7 @@ mouseState = MouseState.LINE_SELECTION; // Disable drag which would otherwise occur when mouse would be over text c.setDragEnabled(false); - if (evt.isControlDown() && evt.isShiftDown()) { + if (isControlShiftDown(evt)) { try { int begOffs = Utilities.getRowStart(c, offset); int endOffs = Utilities.getRowEnd(c, offset); @@ -2781,6 +2781,13 @@ } } + private boolean isControlShiftDown(MouseEvent mouseEvent) { + boolean ctrlDown = org.openide.util.Utilities.isMac() ? mouseEvent.isMetaDown() + : mouseEvent.isControlDown(); + boolean shiftDown = mouseEvent.isShiftDown(); + return ctrlDown && shiftDown; + } + @Override public void mouseReleased(MouseEvent evt) { if (LOG.isLoggable(Level.FINE)) { @@ -2836,7 +2843,7 @@ JTextComponent c = component; if (c != null) { - if (evt.getClickCount() == 1 && evt.isControlDown() && evt.isShiftDown()) { + if (evt.getClickCount() == 1 && isControlShiftDown(evt)) { evt.consume(); // consume event already handled by mousePressed } if (isMiddleMouseButtonExt(evt)) {