File tree 2 files changed +31
-0
lines changed
app/src/processing/app/syntax
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 3
3
import org .fife .ui .rsyntaxtextarea .RSyntaxTextAreaUI ;
4
4
5
5
import javax .swing .*;
6
+ import javax .swing .text .Caret ;
6
7
import javax .swing .text .EditorKit ;
7
8
import javax .swing .text .JTextComponent ;
8
9
@@ -18,4 +19,11 @@ public SketchTextAreaUI(JComponent rSyntaxTextArea) {
18
19
public EditorKit getEditorKit (JTextComponent tc ) {
19
20
return defaultKit ;
20
21
}
22
+
23
+ @ Override
24
+ protected Caret createCaret () {
25
+ Caret caret = new MyConfigurableCaret ();
26
+ caret .setBlinkRate (500 );
27
+ return caret ;
28
+ }
21
29
}
You can’t perform that action at this time.
0 commit comments