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

Mac: Holding down a key causes infinite pressed/typed/released events

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 7u40
    • Fix Version/s: 8
    • Component/s: javafx
    • Environment:

      JDK 7u12 b1, Mac OS X 10.8.2

      Backports

        Description

        When using JDK 7u12 b1 (on Mac OS X), my existing application (game) broke.
        I noticed that holding down a key (something I use for character movement) generates an infinite amount of pressed/typed/released events, even though the key is being held down and is never released.

        This did not happen with JDK 7u10 b15 or JDK 7u9.

        Test case:

        public class KeyDownTest extends Application {
            
            @Override
            public void start(Stage primaryStage) {
                Group root = new Group();
                root.setFocusTraversable(true);
                root.addEventHandler(KeyEvent.ANY, new EventHandler<KeyEvent>() {
                    @Override
                    public void handle(KeyEvent t) {
                        System.out.println(t.getEventType() + " " + t.getCode());
                    }
                });
                
                Scene scene = new Scene(root, 300, 250);
                primaryStage.setScene(scene);
                primaryStage.show();
            }
        }

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  pchelko Petr Pchelko (Inactive)
                  Reporter:
                  simpejfx Steven Van Impe (Inactive)
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Imported: