-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Added preset for new entry keybindings and reintroduced defaults #7705
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 7 commits
2f11418
e358264
a628236
6ad98a9
46a7c6f
bf001e1
bb52b54
055da20
0c1954c
ffa0d60
29053d9
6920fad
b961f92
37f8bc8
8c6ab3c
f865e28
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| package org.jabref.gui.preferences.keybindings.presets; | ||
|
|
||
| import java.util.HashMap; | ||
| import java.util.Map; | ||
|
|
||
| import org.jabref.gui.keyboard.KeyBinding; | ||
|
|
||
| public class NewEntryBindingPreset implements KeyBindingPreset { | ||
|
|
||
| private static final Map<KeyBinding, String> KEY_BINDINGS = new HashMap<>(); | ||
calixtus marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| static { | ||
| // Clear conflicting default presets | ||
| KEY_BINDINGS.put(KeyBinding.PULL_CHANGES_FROM_SHARED_DATABASE, ""); | ||
| KEY_BINDINGS.put(KeyBinding.COPY_PREVIEW, ""); | ||
|
|
||
| // Add new entry presets | ||
| KEY_BINDINGS.put(KeyBinding.NEW_ARTICLE, "Ctrl+shift+A"); | ||
|
||
| KEY_BINDINGS.put(KeyBinding.NEW_BOOK, "Ctrl+shift+B"); | ||
| KEY_BINDINGS.put(KeyBinding.NEW_ENTRY, "Ctrl+N"); | ||
| KEY_BINDINGS.put(KeyBinding.NEW_ENTRY_FROM_PLAIN_TEXT, "Ctrl+shift+N"); | ||
| KEY_BINDINGS.put(KeyBinding.NEW_INBOOK, "Ctrl+shift+I"); | ||
| KEY_BINDINGS.put(KeyBinding.NEW_INPROCEEDINGS, "Ctrl+shift+C"); | ||
| KEY_BINDINGS.put(KeyBinding.NEW_MASTERSTHESIS, "Ctrl+shift+M"); | ||
| KEY_BINDINGS.put(KeyBinding.NEW_PHDTHESIS, "Ctrl+shift+T"); | ||
| KEY_BINDINGS.put(KeyBinding.NEW_PROCEEDINGS, "Ctrl+shift+P"); | ||
| KEY_BINDINGS.put(KeyBinding.NEW_TECHREPORT, "Ctrl+shift+R"); | ||
| KEY_BINDINGS.put(KeyBinding.NEW_UNPUBLISHED, "Ctrl+shift+U"); | ||
| } | ||
|
|
||
| @Override | ||
| public String getName() { | ||
| return "New Entries"; | ||
|
||
| } | ||
|
|
||
| @Override | ||
| public Map<KeyBinding, String> getKeyBindings() { | ||
| return KEY_BINDINGS; | ||
| } | ||
| } | ||

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think ctrl needs to be lowercase5, otherwise the Mac replacement with option might not work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea, I just did it like the other keybindings... Could you test this please? Maybe this is an issue with other keys.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I test it now, works fine. ctrl is mapped to cmd