File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed
app/src/processing/app/syntax Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ package processing .app .syntax ;
2+
3+ import org .fife .ui .rtextarea .ConfigurableCaret ;
4+ import processing .app .helpers .OSUtils ;
5+
6+ import javax .swing .*;
7+ import java .awt .event .MouseEvent ;
8+
9+ public class MyConfigurableCaret extends ConfigurableCaret {
10+
11+ @ Override
12+ public void mouseClicked (MouseEvent e ) {
13+ if (e .isConsumed ()) {
14+ return ;
15+ }
16+
17+ if (!OSUtils .isLinux () && SwingUtilities .isMiddleMouseButton (e )) {
18+ return ;
19+ }
20+
21+ super .mouseClicked (e );
22+ }
23+ }
Original file line number Diff line number Diff line change 33import org .fife .ui .rsyntaxtextarea .RSyntaxTextAreaUI ;
44
55import javax .swing .*;
6+ import javax .swing .text .Caret ;
67import javax .swing .text .EditorKit ;
78import javax .swing .text .JTextComponent ;
89
@@ -18,4 +19,11 @@ public SketchTextAreaUI(JComponent rSyntaxTextArea) {
1819 public EditorKit getEditorKit (JTextComponent tc ) {
1920 return defaultKit ;
2021 }
22+
23+ @ Override
24+ protected Caret createCaret () {
25+ Caret caret = new MyConfigurableCaret ();
26+ caret .setBlinkRate (500 );
27+ return caret ;
28+ }
2129}
You can’t perform that action at this time.
0 commit comments