Skip to content

Commit

Permalink
Input order fixes [release]
Browse files Browse the repository at this point in the history
  • Loading branch information
crschnick committed Jul 26, 2024
1 parent 3357c73 commit f580f39
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ private TableView<BrowserEntry> createTable() {

private void prepareTypedSelectionModel(TableView<BrowserEntry> table) {
AtomicReference<Instant> lastFail = new AtomicReference<>();
table.addEventHandler(KeyEvent.KEY_TYPED, event -> {
table.addEventHandler(KeyEvent.KEY_PRESSED, event -> {
updateTypedSelection(table, lastFail, event, false);
});

Expand All @@ -158,7 +158,7 @@ private void prepareTypedSelectionModel(TableView<BrowserEntry> table) {
}

private void updateTypedSelection(TableView<BrowserEntry> table, AtomicReference<Instant> lastType, KeyEvent event, boolean recursive) {
var typed = event.getCharacter();
var typed = event.getText();
if (typed.isEmpty()) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ private TabPane createTabPane() {
}
});

tabs.addEventFilter(KeyEvent.KEY_PRESSED, keyEvent -> {
tabs.addEventHandler(KeyEvent.KEY_PRESSED, keyEvent -> {
var current = tabs.getSelectionModel().getSelectedItem();
if (current == null) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ private void setupContent(Comp<?> content) {
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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public static Optional<ButtonType> showBlockingAlert(Consumer<Alert> c) {
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();
Expand Down Expand Up @@ -262,7 +262,7 @@ public static void setupContent(
}
});

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();
Expand Down

0 comments on commit f580f39

Please sign in to comment.