-
CSR
-
Resolution: Approved
-
P3
-
None
-
behavioral
-
low
-
New support of Option+Up, Option+Down key combinations
-
Java API
-
SE
Summary
Add support for handling Option+Up or Option+Down key combination on macOS in JTextArea
Problem
Pressing Option+Up or Option+Down key combination in JTextArea is not handled on macOS
Solution
Added support of Option+Up and Option+Down key action in Swing's Default EditorKit class. This requires defining new action names in the public API of DefaultEditorKit.
Specification
javax.swing.text.DefaultEditorKit
+ /**
+ * Name of the {@code Action} for moving the caret
+ * to the beginning of the current line or up to the
+ * beginning of the previous line if the caret is
+ * already at the beginning of the line.
+ * @see #getActions
+ */
+ public static final String beginLineUpAction = "caret-begin-line-and-up";
+
+ /**
+ * Name of the {@code Action} for moving the caret
+ * to the end of the current line or down to the
+ * end of the next line if the caret is already
+ * at the end of the line.
+ * @see #getActions
+ */
+ public static final String endLineDownAction = "caret-end-line-and-down";
+
- csr of
-
JDK-8267374 macOS: Option+Up/Down Arrow don't traverse to beginning/end of line in JTextArea
- Resolved