If I instantiate the GlobalKeyboardHook, with a true parameter, my application stops to recieve the key events. The same with GlobalMouseHook, but for mouse events.
I am writing a Swing application, but I have tested the issue with JavaFX to confirm if it was not a Swing specifc problem.
As example, the below JavaFX application becomes unusable:
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.TextField;
import javafx.scene.layout.HBox;
import javafx.stage.Stage;
import lc.kra.system.keyboard.GlobalKeyboardHook;
import lc.kra.system.mouse.GlobalMouseHook;
public class Test extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) throws Exception {
GlobalMouseHook mouseHook = new GlobalMouseHook(true);
GlobalKeyboardHook keyboardHook = new GlobalKeyboardHook(true);
TextField textField = new TextField();
HBox hBox = new HBox();
hBox.getChildren().add(textField);
Scene scene = new Scene(hBox);
primaryStage.setScene(scene);
primaryStage.show();
}
}
If I instantiate the GlobalKeyboardHook, with a true parameter, my application stops to recieve the key events. The same with GlobalMouseHook, but for mouse events.
I am writing a Swing application, but I have tested the issue with JavaFX to confirm if it was not a Swing specifc problem.
As example, the below JavaFX application becomes unusable: