Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@AmandaBalderas20
Copy link

Closes #14237

I fixed an issue where keyboard shortcuts could not be edited in:
Preferences → Keyboard shortcuts.

The KeyEvent was being consumed by global application shortcuts before reaching
the shortcut editor in the KeyBindingsTab. As a result, pressing keys did not
update the selected shortcut, and changes were not persisted.

This PR adds:

  • A key event filter in KeyBindingsTab to ensure the TreeTableView receives key presses.
  • Logic to forward the event to the ViewModel (setNewBindingForCurrent).
  • Correct persistence of edited shortcuts by syncing the repository into GuiPreferences.
  • An updated JUnit test verifying the binding update behavior.

Steps to test

  1. Open JabRef → Preferences → Keyboard shortcuts.
  2. Select any shortcut entry (e.g., “Close library”).
  3. Press a new key combination (e.g., Ctrl+Shift+L).
  4. Click Save.
  5. Restart JabRef.
  6. Verify that:
    • The new shortcut appears in the list.
    • The shortcut works in the application (e.g., Ctrl+Shift+L closes the library).

Screenshots visible changes are not required since UI remains the same.


Mandatory checks

  • I own the copyright of the code submitted and I license it under the MIT license
  • I manually tested my changes in running JabRef (always required)
  • I added JUnit tests for changes (if applicable)
  • [/] I added screenshots in the PR description (not applicable — UI did not change)
  • [/] I described the change in CHANGELOG.md (not applicable — minor behavior fix)
  • [/] I checked the user documentation: no updates required since UI workflow remains identical

@github-actions
Copy link
Contributor

Hey @AmandaBalderas20!

Thank you for contributing to JabRef! Your help is truly appreciated ❤️.

We have automatic checks in place, based on which you will soon get automated feedback if any of them are failing. We also use TragBot with custom rules that scans your changes and provides some preliminary comments, before a maintainer takes a look. TragBot is still learning, and may not always be accurate. In the "Files changed" tab, you can go through its comments and just click on "Resolve conversation" if you are sure that it is incorrect, or comment on the conversation if you are doubtful.

Please re-check our contribution guide in case of any other doubts related to our contribution workflow.

@Siedlerchr
Copy link
Member

Thanks a lot for your PR, please check the failing tests in KeyBindingsTabModelTest. Maybe they need to be adapted?

@Siedlerchr Siedlerchr added the status: changes-required Pull requests that are not yet complete label Nov 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

first contrib status: changes-required Pull requests that are not yet complete

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to change any keyboard shortcut

2 participants