Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8109793

Key bindings for multi-line textbox does not seem to be matching the native, Win32

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P3 P3
    • None
    • fx1.3
    • javafx

      In a native toolkit, TextArea supports the following key bindings as follows -

      HOME - moves the caret to the beginning of the line
      END - moves the caret to end of the line
      CTRL + HOME - moves the caret to the beginning of the whole text
      CTRL + END - moves the caret to the end of the whole text
      CTRL + SHIFT + HOME - selects text from current position to beginning of the text area
      CTRL + SHIFT + END - selects text from current position to end of text area
      SHIFT + HOME - selects from current position to the beginning of the line
      SHIFT + END - selects from current position to end of the line

      The same set of key bindings are supported by AWT, Swing toolkits as well. But with JavaFX, the behavior of these key bindings are different where HOME/END moves the caret to the beginning and end of text area and CTRL + HOME/END moves the caret with respect to the lines. Same applies for SHIFT combination as well.

      This might take some users by surprise since these key bindings does not match with a native equivalent on the given platform. Is there a specific reason why JavaFX is deviating from the native equivalents?

      I noticed it on Soma-b30, WinXP, WinVista. I have attached a sample test for AWT, Swing and JAvaFX text areas.

        1. TextAreaComparison.java
          0.4 kB
          Praveen Mohan
        2. TextBoxTest13.fx
          2 kB
          Praveen Mohan

            gkbrown Greg Brown (Inactive)
            pmohan Praveen Mohan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: