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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 8
    • 7u40
    • javafx
    • JDK 7u12 b1, Mac OS X 10.8.2

        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();
            }
        }

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

                Created:
                Updated:
                Resolved:
                Imported: