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

[macosx] Mac OS X key event confusion for " COMMAND PLUS "

    XMLWordPrintable

    Details

    • Subcomponent:
    • Introduced In Version:
      7u6
    • Resolved In Build:
      b115
    • OS:
      os_x
    • Verification:
      Verified

      Description

      FULL PRODUCT VERSION :
      1.7.0_25-b15 or 1.8.0-ea-b91 (should be uniform for any JDK 7 or 8)

      ADDITIONAL OS VERSION INFORMATION :
      Mac OS X 8.x (Snow Leopard)

      A DESCRIPTION OF THE PROBLEM :
      This is a Mac OS X specific problem for JDK 7 and JDK 8 (early access).

      COMMAND PLUS produces 3 (equal) events KEY PRESSED instead of just 1.
      In contrast, COMMAND MINUS works as expected.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Use KeyEventDemo.java from http://docs.oracle.com/javase/tutorial/uiswing/events/keylistener.html

      Press COMMAND PLUS, i.e. the regular key labelled " + = " on an English keyboard.


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      KEY PRESSED:
          key code = 61 (Equals)
          extended modifiers = 256 (Meta)
          action key? NO
          key location: standard

      ACTUAL -

      KEY PRESSED
          key code = 61 (Equals)
          extended modifiers = 256 (Meta)
          action key? NO
          key location: standard
      KEY PRESSED:
          key code = 61 (Equals)
          extended modifiers = 256 (Meta)
          action key? NO
          key location: standard
      KEY PRESSED:
          key code = 61 (Equals)
          extended modifiers = 256 (Meta)
          action key? NO
          key location: standard

      That is: 3 events instead of just 1.

      Note that on JDK 6 from Apple, there are slightly different events KEY PRESSED, KEY TYPED, KEY RELEASED, but that is a different story.

      On JDK 7 and 8-ea, COMMAND MINUS produces just one KEY PRESSED event as expected.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      http://docs.oracle.com/javase/tutorial/uiswing/examples/events/KeyEventDemoProject/src/events/KeyEventDemo.java
      ---------- END SOURCE ----------

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                leonidr Leonid Romanov (Inactive)
                Reporter:
                webbuggrp Webbug Group
              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: