-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Fix delete entry keybindings bug #1815
Fix delete entry keybindings bug #1815
Conversation
@@ -299,3 +299,4 @@ @siumed.edu | |||
url = {http://dx.doi.org/10.1016/j.jneumeth.2008.01.009} | |||
} | |||
|
|||
@Comment{jabref-meta: databaseType:bibtex;} |
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.
This is JabRef 3.x - do not change bib files created with old versions of JabRef
17cc8aa
to
86dbd96
Compare
I now found a way to fix it. I am building a String with the English modifier key text using the triggered KeyEvents |
@@ -77,6 +77,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `# | |||
- Fixed a number of issues related to accessing the GUI from outside the EDT | |||
- Added a few missing translation strings | |||
- Fixed NullPointerException when opening Customize entry type dialog without an open database | |||
- Fixed localization error when changing key bindings while not using the english localization |
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.
Instead of "Fixed localization error when changing key bindings ..." I would rather write "Fixed modified keybindings not working ..."
Please resolve conflicts and minor comments, then it's good to me 👍 |
13545a8
to
dfc898c
Compare
@boceckts can you test it on win and mac for me please? The meta key does not work on my linux system since there are OS functions on it. |
@Braunch Windows uses the windows key for its own shortcuts, same as with some linux distributions. On mac it now does work to make shortcuts directly with the command(meta) key....but I just realized that if you create a shortcut with the control key, e.g. "ctrl + S" it will automatically be replaced by "command(meta) + S". |
dfc898c
to
40bc30a
Compare
Is this intended? Why should the grabbed keys differ from the keys actually used by the user? I changed the behavior so that you can set the 'meta + key' shortcut with the meta. |
5717b1e
to
285f1ba
Compare
Any opinion on my solution with the meta key from the @JabRef/developers ? |
5c01a6d
to
fc2b753
Compare
|
||
/** | ||
* respond to grabKey and display the key binding | ||
*/ | ||
public class KeyBindingsListener extends KeyAdapter { | ||
|
||
private final KeyBindingTable table; | ||
private boolean isDeleteKey; |
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.
You don't need to make them class variables, do you?
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.
Still unanswered. 😇 - maybe these variables can now just be deleted?
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.
BUMP
boolean isDeleteKey = kc == KeyEvent.VK_DELETE; | ||
isFunctionKey = (kc >= KeyEvent.VK_F1) && (kc <= KeyEvent.VK_F12); | ||
isEscapeKey = kc == KeyEvent.VK_ESCAPE; | ||
isDeleteKey = kc == KeyEvent.VK_DELETE; | ||
if (!(isFunctionKey || isEscapeKey || isDeleteKey)) { | ||
return; // need a modifier except for function, escape and delete 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.
Move comment form after the return to the line above
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.
BUMP
Please merge |
39cbeb4
to
005d18c
Compare
I addressed the small comments and resolved the conflicts. |
You commited with both your st university address and your normal development address. Please double check your git config. Please merge upstream/master again. Can you make one commit as described at https://github.com/JabRef/jabref/wiki/Tools#rebase-everything-as-one-commit-on-master? Then, I can resolve the conflicts by myself. |
005d18c
to
b646a53
Compare
I resolved the conflicts and squashed my commits. Should be good to go. |
Please do not squash, this makes reviewing very hard as we cannot see, what has been adressed. I added a You can see all comments at https://github.com/JabRef/jabref/pull/1815/files |
I addressed your comments and merged the upstream/master. I squashed following your comment #1815 (comment) Did I get that wrong? |
@@ -45,12 +45,13 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `# | |||
- Selecting an entry in the search result Window will now select the correct entry in the bib file | |||
- Entries in the SearchResultDialog are now converted to Unicode | |||
- Suggestions in the autocomplete (search) are now in Unicode | |||
- Fixed NullPointerException when opening search result window for an untitled database | |||
- Fixed NullPointerException when opening search result window for an untitled database |
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 encountered an unnecessary space so i deleted it
* Fix delete entry keybindings bug * Fix comments and unnecessary class variables
When using a different localization then English, setting the keybindings does not work correctly (see here #1235 ). I figured out that the problem is that the
KeyEvent
returns localized key texts so you can not use this to set theKeyBindings
(the JabRefKeyBindings
use English key texts). At the moment I only see two possibilities that do not end up in comparing tons of Strings to manually get the english localization.First would be to change the locale to English, so that theKeyEvent
returns english key texts, but I don't know what I might break with that and if the rest of the localization will still work.Second solution would be to change theKeyBindings
so that they useKeyCodes
instead of Strings. This would IMHO improve theKeyBindings
system but it would mean a lot of changes in all theKeyBinding
related code.See the comment below for my approach #1815 (comment).