Modify

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 akks)

JOSM should prevent automatically moving of core short cuts when solving shortcut conflicts raised by plugins.

r4079

Attachments (0)

Change History (4)

comment:1 by skyper, 13 years ago

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.

comment:2 by akks, 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?

Last edited 12 years ago by akks (previous) (diff)

comment:3 by stoecker, 12 years ago

When we fix the shortcut conflicts, this shouldn't be an issue any longer.

in reply to:  3 comment:4 by skyper, 12 years ago

Resolution: duplicate
Status: newclosed

Replying to stoecker:

When we fix the shortcut conflicts, this shouldn't be an issue any longer.

Yes, will be fixed with #7226.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.