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

SCROLL_STARTED and SCROLL_FINISHED is not fired using trackpad on windows laptop

XMLWordPrintable

      ADDITIONAL SYSTEM INFORMATION :
      ASUS ZenBook
      Windows 10 Pro (1909)
      OpenJDK 11.0.7
      JavaFX 14.0.1, 15-ea+6

      A DESCRIPTION OF THE PROBLEM :
      Scroll gesture events of type SCROLL isn't surrounded with SCROLL_STARTED and SCROLL_FINISHED when I'm using the integrated touchpad.

      https://javadoc.io/doc/org.openjfx/javafx-base/latest/javafx.graphics/javafx/scene/input/ScrollEvent.html

      The correct sequence of events is generated if to make a gesture on the touch screen.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Run example code
      2. Make a scroll gesture in the opened window (dragging two fingers over a touchpad)

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Events should be generated in the following sequence:
      1. SCROLL_STARTED with touch count 2
      2. multiple SCROLL events with touch count 2
      3. SCROLL_FINISHED with touch count 2
      4. multiple SCROLL events with inertia (optionally)
      ACTUAL -
      only multiple SCROLL events generated.
      Not surrounded with STARTED and FINISHED events.
      Touch count is always zero.

      ---------- BEGIN SOURCE ----------
      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.input.ScrollEvent;
      import javafx.scene.input.ZoomEvent;
      import javafx.scene.layout.Pane;
      import javafx.stage.Stage;

      public class ScrollEventsApp extends Application {

          public static void main(String[] args) {
              Application.launch(args);
          }

          @Override
          public void start(Stage primaryStage) {
              var root = new Pane();
              root.addEventHandler(ScrollEvent.ANY, (event) -> {
                  System.out.print(event.getEventType());
                  System.out.print(" " + event.getTouchCount());
                  if (event.isInertia()) System.out.print(" INERTIA");
                  if (event.isDirect()) System.out.print(" DIRECT");
                  if (event.isAltDown()) System.out.print(" ALT");
                  if (event.isControlDown()) System.out.print(" CTRL");
                  if (event.isMetaDown()) System.out.print(" META");
                  if (event.isShiftDown()) System.out.print(" SHIFT");
                  if (event.isShortcutDown()) System.out.print(" SHORTCUT");
                  System.out.println();
                  event.consume();
              });
              var scene = new Scene(root, 600, 400);
              primaryStage.setScene(scene);
              primaryStage.show();
          }

      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Only using of touchscreen generates correct sequence of events.

      FREQUENCY : always


            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: