RFR: 8267374: (macos) Option+Up/Down arrow dont traverse to beginning/end of line in textarea

Sergey Bylokhov serb at openjdk.org
Wed Jun 22 06:30:53 UTC 2022


On Wed, 22 Jun 2022 03:28:17 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

> Unlike in native "Notes" editor where Option+Up/Down traverses to start/end of each line respectively,
> Java does not honour these key combination in editor.
> 
> Added the key combination support by moving the caret to start/end of line and then doing caret up/down a line depending on if we are pressing UP or DOWN key.

src/java.desktop/share/classes/javax/swing/text/DefaultEditorKit.java line 648:

> 646:      * Name of the <code>Action</code> for moving the caret
> 647:      * to the end of a line and logically upward one position.
> 648:      * @see #getActions

Tested the native behavior in XCode and it seems that this shortcut moves the cursor to the end if not at the end already or one line down otherwise.

-------------

PR: https://git.openjdk.org/jdk/pull/9230



More information about the client-libs-dev mailing list