Hi,
please forgive me if this is not the appropriate place for such kind of
reports.
I've encountered what seems a regression from jfx8, at least on "Ubuntu
16.04".
As stated in the mail object the ENTER key produces no effects inside any
editable components of a webpage.
Note: the CTRL-M works instead.

What follows is a very simple example to illustrate the issue:

import javafx.application.Application;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import javafx.stage.Stage;
import javafx.scene.layout.VBox;
import javafx.scene.input.KeyEvent;

public class WebViewSample extends Application {
    private Scene scene;

    @Override public void start(Stage stage) {
        stage.setTitle("Web View");
WebView editor = new WebView();
WebEngine engine = editor.getEngine();
        engine.setJavaScriptEnabled(true);
engine.loadContent("<textarea rows=25 cols=25>Type content
here...</textarea>");
editor.setContextMenuEnabled(false);
editor.addEventFilter(KeyEvent.KEY_PRESSED, (KeyEvent evt) -> {
System.out.println(evt.getCode()); });
        VBox root = new VBox();
root.getChildren().add(editor);
        scene = new Scene(root,750,500);
        stage.setScene(scene);
        stage.show();
    }

    public static void main(String[] args){
        launch(WebViewSample.class, args);
    }
}

As you can see the ENTER event is intercepted and printed out by the filter
but no newline is added.
This problem should not be confused with an old bug related to the JFXPanel
(here no swing is involved).
I have not tried with the latest builds of openjfx so just in case you are
aware of that and/or the problem is already resolved please ignore this
email.

Kind regards,

Mirco

Reply via email to