Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/main/java/org/jabref/gui/entryeditor/EntryEditor.java
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ public void keyReleased(java.awt.event.KeyEvent e) {

@Override
public void keyPressed(java.awt.event.KeyEvent e) {

//We need to consume this event here to prevent the propgation of keybinding events back to the JFrame
Optional<KeyBinding> keyBinding = Globals.getKeyPrefs().mapToKeyBinding(e);
if (keyBinding.isPresent()) {
Expand All @@ -182,6 +183,10 @@ public void keyPressed(java.awt.event.KeyEvent e) {
case CLOSE_ENTRY_EDITOR:
case DELETE_ENTRY:
case SELECT_ALL:
case ENTRY_EDITOR_NEXT_PANEL:
case ENTRY_EDITOR_NEXT_PANEL_2:
case ENTRY_EDITOR_PREVIOUS_PANEL:
case ENTRY_EDITOR_PREVIOUS_PANEL_2:
e.consume();
break;
default:
Expand Down Expand Up @@ -214,7 +219,7 @@ private void selectLastUsedTab(String lastTabName) {
* Set-up key bindings specific for the entry editor.
*/
private void setupKeyBindings() {
tabbed.addEventFilter(KeyEvent.ANY, event -> {
tabbed.addEventFilter(KeyEvent.KEY_PRESSED, event -> {
Optional<KeyBinding> keyBinding = Globals.getKeyPrefs().mapToKeyBinding(event);
if (keyBinding.isPresent()) {
switch (keyBinding.get()) {
Expand Down Expand Up @@ -820,7 +825,7 @@ public void actionPerformed(ActionEvent e) {
}

BibtexKeyPatternUtil.makeAndSetLabel(panel.getBibDatabaseContext().getMetaData()
.getCiteKeyPattern(Globals.prefs.getBibtexKeyPatternPreferences().getKeyPattern()),
.getCiteKeyPattern(Globals.prefs.getBibtexKeyPatternPreferences().getKeyPattern()),
panel.getDatabase(), entry,
Globals.prefs.getBibtexKeyPatternPreferences());

Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/jabref/gui/keyboard/KeyBinding.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public enum KeyBinding {
COPY_BIBTEX_KEY_AND_LINK("Copy BibTeX key and link", Localization.lang("Copy BibTeX key and link"), "ctrl+alt+K", KeyBindingCategory.EDIT),
COPY_PREVIEW("Copy preview", Localization.lang("Copy preview"), "ctrl+shift+C", KeyBindingCategory.VIEW),
CUT("Cut", Localization.lang("Cut"), "ctrl+X", KeyBindingCategory.EDIT),
//We have to put Entry Editor Previous before, because otherwise the decrease font size is found first
ENTRY_EDITOR_PREVIOUS_PANEL_2("Entry editor, previous panel 2", Localization.lang("Entry editor, previous panel 2"), "ctrl+MINUS", KeyBindingCategory.VIEW),
DECREASE_TABLE_FONT_SIZE("Decrease table font size", Localization.lang("Decrease table font size"), "ctrl+MINUS", KeyBindingCategory.VIEW),
DELETE_ENTRY("Delete entry", Localization.lang("Delete entry"), "DELETE", KeyBindingCategory.BIBTEX),
DOWNLOAD_FULL_TEXT("Look up full text documents", Localization.lang("Look up full text documents"), "alt+F7", KeyBindingCategory.QUALITY),
Expand All @@ -33,7 +35,6 @@ public enum KeyBinding {
ENTRY_EDITOR_NEXT_PANEL_2("Entry editor, next panel 2", Localization.lang("Entry editor, next panel 2"), "ctrl+PLUS", KeyBindingCategory.VIEW),
ENTRY_EDITOR_PREVIOUS_ENTRY("Entry editor, previous entry", Localization.lang("Entry editor, previous entry"), "ctrl+shift+UP", KeyBindingCategory.VIEW),
ENTRY_EDITOR_PREVIOUS_PANEL("Entry editor, previous panel", Localization.lang("Entry editor, previous panel"), "ctrl+shift+TAB", KeyBindingCategory.VIEW),
ENTRY_EDITOR_PREVIOUS_PANEL_2("Entry editor, previous panel 2", Localization.lang("Entry editor, previous panel 2"), "ctrl+MINUS", KeyBindingCategory.VIEW),
FILE_LIST_EDITOR_MOVE_ENTRY_DOWN("File list editor, move entry down", Localization.lang("File list editor, move entry down"), "ctrl+DOWN", KeyBindingCategory.VIEW),
FILE_LIST_EDITOR_MOVE_ENTRY_UP("File list editor, move entry up", Localization.lang("File list editor, move entry up"), "ctrl+UP", KeyBindingCategory.VIEW),
FIND_UNLINKED_FILES("Find unlinked files", Localization.lang("Find unlinked files"), "shift+F7", KeyBindingCategory.QUALITY),
Expand Down