Anjula’s post in Discord:
I’m working on detecting conflicting shortcuts at the moment. What I’m thinking is maybe check for duplicate shortcuts after loading the entire keymap file, rather than checking while reading each shortcut. Would that be okay?
If we check while loading each shortcut, IMO, there’s an disadvantage. Nothing significant, but still…
Let’s assume X, Y are two commands. We change X’s shortcut to Y’s default shortcut, and Y’s shortcut to X’s default shortcut.
If we check conflicts after doing all these changes, then there wouldn’t be an issue.
If we are parsing X first, then it would cause an issue since it’s used in Y too, and I think using some advanced algorithm for this is over-engineering, since editing the keymap file is a feature for advanced users.
In the shortcut editor however, we can just warn the user.
I’m thinking of getting these tasks done in Phase 1:
- Complete implementation of the Keymap handler module (PR: https://github.com/laurent22/joplin/pull/3252) and get it merged
- Write more unit tests and feature tests for Keymap handler
- Write a reference guide for custom keymaps
- Finalize designs (UML diagrams might be very useful) for Keymap config screen, and start implementation
Please give your feedback on this @tessus and @bedwardly-down. IMO, I think #1 should be merged first. I’m also designing keymap config screen at the moment, and it heavily depends on the Keymap handler module.
I’ll post my designs very soon, so I can get your feedback and make changes before implementation.