From f580f39e86dda3157413b5cfc7bc83aef7cf82e1 Mon Sep 17 00:00:00 2001 From: crschnick Date: Fri, 26 Jul 2024 16:58:53 +0000 Subject: [PATCH] Input order fixes [release] --- .../java/io/xpipe/app/browser/file/BrowserFileListComp.java | 4 ++-- .../io/xpipe/app/browser/session/BrowserSessionTabsComp.java | 2 +- app/src/main/java/io/xpipe/app/core/window/AppMainWindow.java | 2 +- .../main/java/io/xpipe/app/core/window/AppWindowHelper.java | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/io/xpipe/app/browser/file/BrowserFileListComp.java b/app/src/main/java/io/xpipe/app/browser/file/BrowserFileListComp.java index 5e360ad8a..091667fc7 100644 --- a/app/src/main/java/io/xpipe/app/browser/file/BrowserFileListComp.java +++ b/app/src/main/java/io/xpipe/app/browser/file/BrowserFileListComp.java @@ -135,7 +135,7 @@ public final class BrowserFileListComp extends SimpleComp { private void prepareTypedSelectionModel(TableView table) { AtomicReference lastFail = new AtomicReference<>(); - table.addEventHandler(KeyEvent.KEY_TYPED, event -> { + table.addEventHandler(KeyEvent.KEY_PRESSED, event -> { updateTypedSelection(table, lastFail, event, false); }); @@ -158,7 +158,7 @@ public final class BrowserFileListComp extends SimpleComp { } private void updateTypedSelection(TableView table, AtomicReference lastType, KeyEvent event, boolean recursive) { - var typed = event.getCharacter(); + var typed = event.getText(); if (typed.isEmpty()) { return; } diff --git a/app/src/main/java/io/xpipe/app/browser/session/BrowserSessionTabsComp.java b/app/src/main/java/io/xpipe/app/browser/session/BrowserSessionTabsComp.java index f4d3482bc..8cef777bd 100644 --- a/app/src/main/java/io/xpipe/app/browser/session/BrowserSessionTabsComp.java +++ b/app/src/main/java/io/xpipe/app/browser/session/BrowserSessionTabsComp.java @@ -193,7 +193,7 @@ public class BrowserSessionTabsComp extends SimpleComp { } }); - tabs.addEventFilter(KeyEvent.KEY_PRESSED, keyEvent -> { + tabs.addEventHandler(KeyEvent.KEY_PRESSED, keyEvent -> { var current = tabs.getSelectionModel().getSelectedItem(); if (current == null) { return; diff --git a/app/src/main/java/io/xpipe/app/core/window/AppMainWindow.java b/app/src/main/java/io/xpipe/app/core/window/AppMainWindow.java index 102695ddb..0ed9470c5 100644 --- a/app/src/main/java/io/xpipe/app/core/window/AppMainWindow.java +++ b/app/src/main/java/io/xpipe/app/core/window/AppMainWindow.java @@ -273,7 +273,7 @@ public class AppMainWindow { contentR.prefHeightProperty().bind(stage.getScene().heightProperty()); if (OsType.getLocal().equals(OsType.LINUX) || OsType.getLocal().equals(OsType.MACOS)) { - stage.getScene().addEventFilter(KeyEvent.KEY_PRESSED, event -> { + stage.getScene().addEventHandler(KeyEvent.KEY_PRESSED, event -> { if (new KeyCodeCombination(KeyCode.W, KeyCombination.SHORTCUT_DOWN).match(event)) { AppPrefs.get().closeBehaviour().getValue().run(); event.consume(); diff --git a/app/src/main/java/io/xpipe/app/core/window/AppWindowHelper.java b/app/src/main/java/io/xpipe/app/core/window/AppWindowHelper.java index 25341e111..320a05624 100644 --- a/app/src/main/java/io/xpipe/app/core/window/AppWindowHelper.java +++ b/app/src/main/java/io/xpipe/app/core/window/AppWindowHelper.java @@ -144,7 +144,7 @@ public class AppWindowHelper { event.consume(); }); AppWindowBounds.fixInvalidStagePosition(s); - a.getDialogPane().getScene().addEventFilter(KeyEvent.KEY_PRESSED, event -> { + a.getDialogPane().getScene().addEventHandler(KeyEvent.KEY_PRESSED, event -> { if (new KeyCodeCombination(KeyCode.W, KeyCombination.SHORTCUT_DOWN).match(event)) { s.close(); event.consume(); @@ -262,7 +262,7 @@ public class AppWindowHelper { } }); - scene.addEventFilter(KeyEvent.KEY_PRESSED, event -> { + scene.addEventHandler(KeyEvent.KEY_PRESSED, event -> { if (new KeyCodeCombination(KeyCode.W, KeyCombination.SHORTCUT_DOWN).match(event)) { stage.close(); event.consume();