Skip to content

Commit

Permalink
[fix] Emacs key bindings can now be used in all classes that inherit …
Browse files Browse the repository at this point in the history
…TextInputControl

[Issue: #9]
  • Loading branch information
krisgun committed Feb 27, 2020
1 parent 66898de commit f7f4348
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/main/java/org/jabref/gui/keyboard/EmacsKeyBindings.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@
import java.util.Optional;

import javafx.scene.Scene;
import javafx.scene.control.TextField;
import javafx.scene.control.TextInputControl;
import javafx.scene.input.KeyEvent;

import org.jabref.logic.util.strings.StringChangeNextWord;

public class EmacsKeyBindings {
public static void executeEmac(Scene scene, KeyEvent event, boolean EmacsFlag, boolean CAFlag, boolean CFFlag, boolean CNFlag, boolean AUFlag, KeyBindingRepository keyBindingRepository) {
if (EmacsFlag && scene.focusOwnerProperty().get() instanceof TextField) {
//KeyBindingRepository keyBindingRepository = Globals.getKeyPrefs();
TextField focusedTextField = (TextField) scene.focusOwnerProperty().get();
if (EmacsFlag && scene.focusOwnerProperty().get() instanceof TextInputControl) {
TextInputControl focusedTextField = (TextInputControl) scene.focusOwnerProperty().get();
Optional<KeyBinding> keyBinding = keyBindingRepository.mapToKeyBinding(event);
if (keyBinding.isPresent()) {
if (keyBinding.get().equals(KeyBinding.EMACS_DELETE)) {
Expand Down

0 comments on commit f7f4348

Please sign in to comment.