Opened 13 years ago
Closed 12 years ago
#6341 closed enhancement (duplicate)
prevent automatically moving of core short cuts.
Reported by: | skyper | Owned by: | team |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | Core | Version: | latest |
Keywords: | move short cut | Cc: |
Description (last modified by )
JOSM should prevent automatically moving of core short cuts when solving shortcut conflicts raised by plugins.
Attachments (0)
Change History (4)
comment:1 by , 13 years ago
comment:2 by , 12 years ago
Description: | modified (diff) |
---|
Replying to [stoecker]:
Replying to [akks]:
Another idea (I cannot find exact ticket but it is not new).
Is it possible to protect all core shortcuts like Alt-A from automatic changing by plugins?
Add some registerCoreShortcut, for example, with higher priority?
When plugin intends explicitly to replace core shortcut, it should also call some special function.
This can prevent many problems...
This is not as easy as you think. JOSM core does not know what shortcuts it has, as they are initialized only, when function is activated. So not all shortcuts are known before the plugins are registered.
The initial shortcut handling had a "remember all shortcuts whenever seen at least once". I disabled that mode, as it would prevent fixing broken shortcuts (the users would get a permanently saved redirect shortcut, which is not changeable by program updates).
If you have a good idea how to work around this problem ...
Probably a timed "remember shortcut whenever seen" which drops the information after a certain unused time and also updates the value, when default changes. I.e. don't store the real final shortcut, but store the information which leads to that shortcut and simply reconstruct all core shortcuts on startup. Ideas and code welcome.
BTW: I deprecated the Shortcut calls passing modifiers as argument. They should be converted to proper usage of GROUPS_ALT1 and ALT2. I will update the table, so that it converts group to corresponding modifier in the list, so it is better human readable in future (when I have time...).
Idea of workaround:
- Register core shortcuts with function different call (search&replace in core? or use something like CodeBase?)
- Plugin shortcut can take core key if initialized earluier
- When core registers the shortcut and notice that it is used by plugin, it should take it back and move plugin shortcut to other free or non-core key.
I do not know if this is possible. What do you think?
follow-up: 4 comment:3 by , 12 years ago
When we fix the shortcut conflicts, this shouldn't be an issue any longer.
comment:4 by , 12 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
Maybe some code is needed to check shortcuts and give an error if there is a shortcut conflict within core (See Ticket 67).
This code could be used for plugins, too.