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

Mac: correct KeyEvent.PRESS/TYPED/RELEASE behavior wrt. auto-repeat feature

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • fx2.0.2
    • fx2.0.2
    • javafx
    • None
    • Mac

      Glass on Mac sends a PRESS key event for each keyDown native notification regardless of whether this is an auto-repeat press event or not.

      Also, the TYPED event is generated synthetically just after the PRESS event. (see GlassView2D/3D.m keyDown:).

      On Windows when OS generates auto-repeat key press events, the event sequence is as following:

      PRESS
      TYPED
      TYPED
      ...
      RELEASE

      We need to make Glass on Mac behave the same way.

      Also note that for Cmd+<> key sequences Mac doesn't generate a RELEASE event, therefore we syntehsize the event ourselves (see GlassViewDelegate.m sendJavaKeyEvent:). According to the events provide by the native OS, it seems that if user holds a Cmd+<> key and the system generates auto-repeat events, we have no choice but generate

      PRESS
      TYPED
      RELEASE
      PRESS
      TYPED
      RELEASE
      ...

      Seems that for Cmd+<> key combinations this is unavoidable.

            anthony Anthony Petrov (Inactive)
            anthony Anthony Petrov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: