Modify

Opened 8 years ago

Closed 7 years ago

#7226 closed enhancement (fixed)

Normalizing shortcuts

Reported by: akks Owned by: stoecker
Priority: normal Milestone:
Component: Core Version: latest
Keywords: shortcuts Cc:

Description

Currently we have periodic problems with shortcut conflicts within core and plugins.
(and possible partial solutions like #6341)

To fix such problems and choose correct shorcut for added actions one need some
information and rules.

I have made "shorcut list maker"-script (code parser that finds all registerShortcut calls and converts it to html tale form) to help diagnose possible and existing problems.

For example, it shows which 14 (!) shortcuts are assigned to R.
Maybe it can be useful as a part of source or trac/wiki.

Attachments (4)

Shortcuts.py (3.0 KB) - added by akks 8 years ago.
shortcuts.html (56.7 KB) - added by akks 8 years ago.
script output for current josm and plugins
UnDeprecateShortcuts.pl (4.1 KB) - added by akks 8 years ago.
big.patch (88.6 KB) - added by akks 8 years ago.

Download all attachments as: .zip

Change History (107)

Changed 8 years ago by akks

Attachment: Shortcuts.py added

Changed 8 years ago by akks

Attachment: shortcuts.html added

script output for current josm and plugins

comment:1 Changed 8 years ago by akks

More convenient link: https://josm.openstreetmap.de/raw-attachment/ticket/7226/shortcuts.html

By the way - what are the rules to choose group of shortcut?
We have too many shortcuts in plugins with like

GROUP_EDIT +	SHIFT_DOWN_MASK|ALT_DOWN_MASK
GROUP_MENU +	CTRL_DOWN_MASK | ALT_DOWN_MASK

to get exact modificator list...

comment:2 Changed 8 years ago by stoecker

Owner: changed from team to stoecker

comment:3 Changed 8 years ago by stoecker

Good idea. We could have done this years ago :-)

Thanks for the script, but we need to use the already existing infrastructure. This consists of two parts:

  • a Perl script as cron job
  • Python-Instances for Trac

The help topics already parse the java files and produce a table, so most work is already there and only needs to be extended. You could ease my work a bit, when you extract:

a) The RegEx-parsing instruction to find all key codes:

  • The script already parses all files line by line and remembers line no. and file for data found (help topics for now)
  • Result will be a CSV file

b) Wiki format style method to display information (i.e. one example table layout)

  • This will be a few lines python script using the CSV as input, essentially a "read lines and output as wiki syntax" loop with some additional overhead.

comment:4 Changed 8 years ago by akks

I am not so good in regexp, espcially in Perl :) , so I just find corresponding calls by

re.findall("\.registerShortcut[^\;]*\;",text,re.S+re.M)

extract all list of argumets with

m=re.search("\.registerShortcut([^\;]*)",s)

and find all parameters manually, because I do not know, how to implement brace-macthing by regexp ( we need to find only top-level splitters "," . There are calls like

        super(tr("Create Circle"), "createcircle", tr("Create a circle from three selected nodes."),
                Shortcut.registerShortcut("tools:createcircle", tr("Tool: {0}", tr("Create Circle")), KeyEvent.VK_O, Shortcut.GROUP_EDIT, Shortcut.SHIFT_DEFAULT), true);

and

                Shortcut.registerShortcut("tools:multipoly", tr("Tool: {0}", tr("Create multipolygon")),
                        KeyEvent.VK_A, Shortcut.GROUP_DIRECT, KeyEvent.ALT_DOWN_MASK | KeyEvent.CTRL_DOWN_MASK ), true);

to make our task harder...
CSV and wiki syntax should not be a problem, I can do it at any time.

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

comment:5 in reply to:  4 Changed 8 years ago by stoecker

Replying to akks:

I am not so good in regexp, espcially in Perl :) , so I just find corresponding calls by

Well, nearly everybody uses perl regexp nowadays, so that is language independent. Learning RegExp is always a good idea. It makes text processing so much easier.

to make our task harder...

I feared that multi-line statements need to be detected, but at least the first line is the match indicator which makes it easier. I will see if I find time this weekend.

Shouldn't be soo complicated.

comment:6 Changed 8 years ago by stoecker

See [DevelopersGuide/ShortcutsList].

I currently join up to 3 lines, but there are still some parsing errors which would need to be updated in code.

comment:7 Changed 8 years ago by akks

Thank you for your work!

Do we need to edit the code now? How can I check that new variant will be parsed OK before commiting?
Is it the best way to put Shortcut.registerShortcut(.....) in single line?

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

comment:8 Changed 8 years ago by akks

I tried to change the code of utilspluguin2 to be simpler for parser - [o27543],[o27544]...
It seems, brace-matching is essential part of the script.

I can ot figure the logic of active script - it finds shortcuts in

super(tr("Split Way"), "splitway", tr("Split a way at the selected node."),
      Shortcut.registerShortcut("tools:splitway", tr("Tool: {0}", tr("Split Way")), KeyEvent.VK_P, Shortcut.GROUP_EDIT), true);
  putValue("help", ht("/Action/SplitWay"));

regexp matching
and

super(tr("Adjacent nodes"), "adjnodes", tr("Select adjacent nodes"),
                Shortcut.registerShortcut("tools:adjnodes", tr("Tool: {0}","Adjacent nodes"),
                KeyEvent.VK_E, Shortcut.GROUP_EDIT), true);
putValue("help", ht("/Action/AdjacentNodes"));

but does not find in

   super(tr("Split Object"), "splitobject", tr("Split an object at the selected nodes."),
	                Shortcut.registerShortcut("tools:splitobject", tr("Tool: {0}", "Split Object"),
	                        KeyEvent.VK_P,  Shortcut.SHIFT_DEFAULT), true);
	        putValue("help", ht("/Action/SplitObject"));

Maybe it should stop on first ";"? Or the problem is different? I can try to make a patch for script if you show it...

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

comment:9 Changed 8 years ago by stoecker

First version, there may still be bugs :-)

comment:10 Changed 8 years ago by stoecker

Regexp:

 $last =~ s/^[\t ]*(.*?)[\t\r\n ]*$/$1/;
 $last2 =~ s/^[\t ]*(.*?)[\t\r\n ]*$/$1/;
 $l =~ s/^[\t ]*(.*?)[\t\r\n ]*$/$1/;
 $l = "$last$last2$l";
 $l =~ s/^.*(Shortcut\.register)/$1/;
 $l =~ s/\t/ /g;
 $l =~ s/tr\(("[^"]+")\)/$1/g;
 $l =~ s/trc\("[^"]+", *("[^"]+")\)/$1/g;
 $l =~ s/tr\(("[^"]*)\{0\}([^"]*"), *"([^"]+)"\)/$1$3$2/g;
 if($l =~ /^Shortcut.registerShortcut\( *"([^"]+)", *"([^"]+)" *, *KeyEvent.VK_([A-Z0-9_]+) *, *(Shortcut.GROUP[0-9a-zA-Z+_. ]+)(?: *, *((?:KeyEvent|InputEvent|Shortcut)\.[0-9A-Za-z._| ]+ *))?\)/)

comment:11 Changed 8 years ago by stoecker

"Split Object": This call is wrong. The group was missing (is fixed now).

comment:12 in reply to:  10 Changed 8 years ago by akks

Replying to stoecker:

Regexp:

 $last =~ s/^[\t ]*(.*?)[\t\r\n ]*$/$1/;
 $last2 =~ s/^[\t ]*(.*?)[\t\r\n ]*$/$1/;
 $l =~ s/^[\t ]*(.*?)[\t\r\n ]*$/$1/;
 $l = "$last$last2$l";
 $l =~ s/^.*(Shortcut\.register)/$1/;
 $l =~ s/\t/ /g;
 $l =~ s/tr\(("[^"]+")\)/$1/g;
 $l =~ s/trc\("[^"]+", *("[^"]+")\)/$1/g;
 $l =~ s/tr\(("[^"]*)\{0\}([^"]*"), *"([^"]+)"\)/$1$3$2/g;
 if($l =~ /^Shortcut.registerShortcut\( *"([^"]+)", *"([^"]+)" *, *KeyEvent.VK_([A-Z0-9_]+) *, *(Shortcut.GROUP[0-9a-zA-Z+_. ]+)(?: *, *((?:KeyEvent|InputEvent|Shortcut)\.[0-9A-Za-z._| ]+ *))?\)/)

Wow :) Will wiki update automatically after commits to see if parsing problem is gone? Or please update it, so I can see if changes were right :)

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

comment:13 Changed 8 years ago by stoecker

Max. 10 minutes after checking it should update :-)

comment:14 in reply to:  13 ; Changed 8 years ago by akks

Replying to stoecker:

Max. 10 minutes after checking it should update :-)

It works, it works! :-) I notice error list is almost updated automtically. Am I right or you are patching it manually every 15 min?

comment:15 Changed 8 years ago by akks

Maybe it would be good to include Josm SVN revision number and plugin repository revision in header or footer of DevelopersGuide/ShortcutsList

comment:16 in reply to:  14 Changed 8 years ago by stoecker

Replying to akks:

It works, it works! :-) I notice error list is almost updated automtically. Am I right or you are patching it manually every 15 min?

Max. 10 Minutes. This also includes immediate update in seldom cases :-)

comment:17 Changed 8 years ago by stoecker

In [4851/josm]:

allow automatic parsing of shortcuts see #7226

comment:18 Changed 8 years ago by akks

Puff, almost all parser bugs cleared. Your Regexp is really good.

What left:

  • 3core+1plugin shortcuts depending on parameters (maybe you will hardcode ones from core in wiki?)
  • 1 shortcut with strange ",0" in registerShortcut().


comment:19 Changed 8 years ago by stoecker

For the remaining ones, the parser must be modified.

comment:20 Changed 8 years ago by akks

But parser cannot know anything about real dynamically constructed shortcuts from MainMenu and LayerListDialog...

You can scan for addMenu() calls, but some static part will remain. Maybe it is easier to maintain it manually?

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

comment:21 Changed 8 years ago by stoecker

We will see...

comment:22 Changed 8 years ago by akks

I noticed that the parser is searching for shortcuts in commented linees like
http://josm.openstreetmap.de/browser/trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java#L979

this may be confusing when eliminating conflicts...

comment:23 Changed 8 years ago by 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...

comment:24 in reply to:  23 ; Changed 8 years ago by 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...).

comment:25 in reply to:  24 Changed 8 years ago by skyper

Replying to stoecker:

Replying to akks:

Another idea (I cannot find exact ticket but it is not new).

#6341 is already mentioned in the ticket description

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

There exists the so far manually updated Shortcuts page on the wiki.

comment:26 Changed 8 years ago by akks

I posted some other idea in #6341...

comment:27 Changed 8 years ago by stoecker

I updated the DevelopersGuide/ShortcutsList page a lot. Now the complete shortcut as well as the shortcut groups are displayed.

Aim would be to remove all function calls with direct modifiers by selecting a proper group instead. Help to do so is welcome. The corresponding function calls are deprecated now and will be removed in future.

Maybe we need to add a ALT3 setting to increase the number of possibilities?

Next step: All conflicts should be removed step by step.

comment:28 in reply to:  27 ; Changed 8 years ago by akks

Replying to stoecker:

I updated the DevelopersGuide/ShortcutsList page a lot. Now the complete shortcut as well as the shortcut groups are displayed.

Aim would be to remove all function calls with direct modifiers by selecting a proper group instead. Help to do so is welcome. The corresponding function calls are deprecated now and will be removed in future.

Maybe we need to add a ALT3 setting to increase the number of possibilities?

Next step: All conflicts should be removed step by step.

It looks great, thank you for yor work!

Removing modifiers can be hard. Lots of shortcus, especially in plugins, has random group associated - just to get wanted shortcut :)

We need some guide - which shortcuts should be in LAYER or MENU group. What is the logical difference between EDIT, DIRECT and HOTKEY? Many of the developers (including me) does not know it exactly.

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

comment:29 in reply to:  28 Changed 8 years ago by stoecker

Replying to akks:

We need some guide - which shortcuts should be in LAYER or MENU group. What is the logical difference between EDIT, DIRECT and HOTKEY? Many of the developers (including me) does not know it exactly.

I added some comments about this in the dev page, but probably we need to improve the groups in future.

comment:30 Changed 8 years ago by stoecker

All remaining parsing errors are fixed.

comment:31 Changed 8 years ago by stoecker

I now added DIRECT2 group (in r4923). Most actions probably should be switched to DIRECT or DIRECT2, others to EDIT. When using DIRECT2 in plugins, they need master version 4923 in build.xml.

comment:32 Changed 8 years ago by akks

Small bug in shortcut table - Shortcut is not reconstructed correctly:
Z SHIFT+Z ​SelectModNodesAction.java EDIT SHIFT tools:selmodnodes Tool: Select last modified nodes
Z SHIFT+Z ​UndoSelectionAction.java MENU SHIFT tools:undoselection Tool: Undo selection
Undo selection really goes to Alt-SHIFT-Z. Does it work OK without modificators only?

By the way, where should all selection menu shortcuts go - to DIRECT and DIRECT2?
(as I understood, I should move SelectModNodesAction to ALT1+DIRECT and UndoSelectionAction to ALT1+DIRECT2? )

comment:33 in reply to:  32 Changed 8 years ago by stoecker

Replying to akks:

Small bug in shortcut table - Shortcut is not reconstructed correctly:
Z SHIFT+Z ​SelectModNodesAction.java EDIT SHIFT tools:selmodnodes Tool: Select last modified nodes
Z SHIFT+Z ​UndoSelectionAction.java MENU SHIFT tools:undoselection Tool: Undo selection
Undo selection really goes to Alt-SHIFT-Z. Does it work OK without modificators only?

Fixed. SHIFT_DEFAULT does not replace, but add the SHIFT key.

By the way, where should all selection menu shortcuts go - to DIRECT and DIRECT2?
(as I understood, I should move SelectModNodesAction to ALT1+DIRECT and UndoSelectionAction to ALT1+DIRECT2? )

Shouldn't Menu-Shortcuts be in MENU group?

comment:34 Changed 8 years ago by akks

So simple :) But half of menu items are in EDIT group now...

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

comment:35 Changed 8 years ago by akks

I tried to remove modifiers from registerShortcut calls in Utilsplugin2: [o27761]. Please tell me if something is wrong.

comment:36 Changed 8 years ago by akks

On question from mail list:
I propose to move eXport and eXtract plugin actions to underpopulated X with modifiers :)

comment:37 in reply to:  36 Changed 8 years ago by stoecker

Replying to akks:

On question from mail list:
I propose to move eXport and eXtract plugin actions to underpopulated X with modifiers :)

Go on.

comment:38 Changed 8 years ago by glebius

r4953 introduced a conflict between core and surveyor plugin:

+            Shortcut.registerShortcut("core_multikey:showHideLayer", tr("Multikey: {0}",
+            tr("Show/hide layer")), KeyEvent.VK_S, Shortcut.GROUP_DIRECT+Shortcut.GROUPS_ALT1).setAccelerator(this);

The surveyor needs to be disabled for JOSM to function properly. Can you please fix it?

comment:39 Changed 8 years ago by stoecker

Already fixed that conflict, but plugins jars will not be released until all fixes are done.

comment:40 Changed 8 years ago by rickmastfan67

Thought I would post this in here because it has to deal with a weird shortcut conflict I just got.

Recently, when the "Curves" plugin was integrated into Utilsplugin2, it created a shortcut conflict with the licensechange plugin. (this isn't the "weird" part yet)

Silent shortcut conflict: 'tools:licensechange' moved by 'tools:createcurve' to 'Alt+Shift+C'.

When I just opened up a file in r4961, I get this brand new conflict that I bet was introduced by [4951]:

Silent shortcut conflict: 'subwindow:conflict' moved by 'tools:licensechange' to ''.

This wasn't happening back in r4949 the other day.

Just thought I would let you guys know about this one because I've never seen something like this happen when there was a conflict.

Repository Root: http://josm.openstreetmap.de/svn
Build-Date: 2012-02-17 02:32:15
Last Changed Author: stoecker
Revision: 4961
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
URL: http://josm.openstreetmap.de/svn/trunk
Last Changed Date: 2012-02-16 21:21:17 +0100 (Thu, 16 Feb 2012)
Last Changed Rev: 4961

Identification: JOSM/1.5 (4961 en)
Memory Usage: 122 MB / 2730 MB (81 MB allocated, but free)
Java version: 1.6.0_31, Sun Microsystems Inc., Java HotSpot(TM) 64-Bit Server VM
Operating system: Windows 7

Plugin: OpeningHoursEditor (27676)
Plugin: buildings_tools (27676)
Plugin: imageryadjust (27744)
Plugin: licensechange (27676)
Plugin: mapdust (27596)
Plugin: measurement (27464)
Plugin: openstreetbugs (27355)
Plugin: reverter (27676)
Plugin: turnrestrictions (27676)
Plugin: undelete (27649)
Plugin: utilsplugin2 (27761)

comment:41 Changed 8 years ago by stoecker

The count of free key combinations rapidely decreases due to fixing the remaining conflicts :-)

comment:42 Changed 8 years ago by akks

Yes, unfortunately...
Oh, we can use some multikey shortcus for rare actions :)

There are some unsupported or even not published plugins that own some keys. I am contacting authors of IrsRectify and RGisOpen.

comment:43 Changed 8 years ago by stoecker

We still have numbers, dots, comma and - for assignment. Rare plugins will get one of these :-)

comment:44 Changed 8 years ago by akks

Err, FastDraw is not used SO rarely to put on CTRL-ALT-SHIFT-T :) Check the staistics (I always wanted to know its percentage too).
If not T, then maybe Ctrl-Alt-F? I would prefer to exchange Shift-F <->Ctrl-Alt-F then, but it depends on usage statistics.
p.s. Oh, sorry - it is occupied...

Besides, I had already moved TaggingPresetTester on that key [o27823] , so the conflict persist.

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

comment:45 Changed 8 years ago by akks

Shift-R in utilsplugin2 does the same thing as in Potlatch. Maybe we should leave it...

comment:46 Changed 8 years ago by akks

And AddIntersections from Utilsplugin2 that was on Shift-I (very old action) are used much more intensively (for fixing road nets) than ImportVector, which needs selecting file by mouse anyway.

comment:47 Changed 8 years ago by stoecker

Feel free to shift around where logical.

comment:48 Changed 8 years ago by akks

You are doing very hard and huge job that people will mostly hate for the first time :) I think that it is really important to have good structure of shortcut system.

I am adraid I can make even more mess while you are editing. I'll try to do some refinement tomorrow :)
Maybe some more people will post their advice...

comment:49 Changed 8 years ago by stoecker

I'm done for today.

And it is not the first time people blame me and later everybody agrees that my changes have been good :-)

comment:50 Changed 8 years ago by akks

Then I will make some plugin commits carefully now:)

comment:51 Changed 8 years ago by akks

Maybe we need some structure or core extension for all "Import*" plugins. For example, ImportVec import SVG (asking for additional parameters), there is also PdfImport. All of them need unique shortcuts now :) (such problem for GPX was solved...)

comment:52 Changed 8 years ago by akks

I like Upload/Download on Ctrl-Shift-Up/Down :) Very fresh idea! (not a joke)

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

comment:53 Changed 8 years ago by stoecker

In r4972 I reworked the system again. Now also removing the "cascading" conflict handling. The old group names are now deprecated and replaced by more descriptive ones. When you do further changes, please use the new names and version 4972.

I now try to update the shortcut page script to reflect my changes. :-)

comment:54 Changed 8 years ago by Don-vip

There's a problem in r4975 that prevents JOSM to start, I've got a java.lang.StackOverflowError :(

comment:55 Changed 8 years ago by akks

I tried to make an autoreplace script to eliminate most of shortcut deprecations in r4972.
I am afraid it will brake something if I commit it (forgot Shortcut.java file? anything else?). At least it compiles and runs)

I am attaching Perl script and example generated patch. Attention - run in new trunk copy, since it changes all file dates and line endings.

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

Changed 8 years ago by akks

Attachment: UnDeprecateShortcuts.pl added

Changed 8 years ago by akks

Attachment: big.patch added

comment:56 Changed 8 years ago by akks

Please edit the script and commit when it is suitable time )

comment:57 Changed 8 years ago by stoecker

In 4982/josm:

see #7226 - patch by akks (fixed a bit) - fix shortcut deprecations

comment:58 Changed 8 years ago by stoecker

Only 3 lines have been wrong and one place overlooked :-)

comment:59 Changed 8 years ago by Kai Pastor

CTRL-P is a standard shortcut for printing in other applications. Either the print plugin keeps that shortcut, or there will be no shortcut for printing. Moving to another shortcut makes no sense.

comment:60 in reply to:  59 Changed 8 years ago by stoecker

Replying to Kai Pastor:

CTRL-P is a standard shortcut for printing in other applications. Either the print plugin keeps that shortcut, or there will be no shortcut for printing. Moving to another shortcut makes no sense.

Agreed. Moved the conflicting "Split" to <CTRL>+<X> (X is at least a bit logical for split).

comment:61 Changed 8 years ago by akks

It is good, but does not Ctrl-X work as "Cut"?

comment:62 in reply to:  61 Changed 8 years ago by stoecker

Replying to akks:

It is good, but does not Ctrl-X work as "Cut"?

Sure. Now <ALT>. Hmm, why is cut not in the table...

comment:63 Changed 8 years ago by akks

When we were discussing delete mode on the forum, we almost decided to move it on Ctrl-Alt-Del. I was ready to implement it :)

Also thank you for plugins update for de-deprecation.

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

comment:64 in reply to:  63 ; Changed 8 years ago by Don-vip

Replying to akks:

we almost decided to move it on Ctrl-Alt-Del.

Not a good idea on Windows ;)

comment:65 in reply to:  64 Changed 8 years ago by skyper

Replying to Don-vip:

Replying to akks:

we almost decided to move it on Ctrl-Alt-Del.

Not a good idea on Windows ;)

On Linux neither, as you can set an option in xorg.conf to allow Ctrl-Alt-Del also on X and not only on the terminal.

comment:66 Changed 8 years ago by Don-vip

In 4986/josm:

see #7226 - update Windows system shortcuts

comment:67 Changed 8 years ago by akks

No more conflicts with our Utilsplugin2. But I changed menu MoreTools to Alt-Q. So some systematization follows... :)

We have too many keys for plugin menus with 1-3 items. Maybe some joining is needed?

Standard menus - Alt-E, Alt-F, Alt-H, Alt-I, Alt-P, Alt-U, Alt-T, Alt-V, Alt-W, OK.

  • TrustOsm ALT-B - 1 item (!)
  • Cadastre-fr ALT-C - 5 items, All OK
  • VideoMapping ALT-D - 15 items, All OK
  • LiveGPS ALT-G - 3 items ~ok
  • WalkingPapers ALT-K - 1 item (!)
  • PicLayer ALT-L, 9 items, All OK
  • Command Line ALT-M, many items when scripts installed, All OK (maybe change acccelerator?)
  • Conflation, newly added, ALT-R, 1 item (!) (conflict)
  • Utilsplugin2 Selection menu Alt-N, ~9 items, OK (strange accelerator?)
  • Utilsplugin2 More Tools menu Alt-Q, ~9 items, strange but convenient accelerator (elsewhere conflict)
  • Routing Alt-O ~6 items, OK
  • Mirrored Download Alt-P 2 items, conflict with core
  • Public Transport Alt-P 3 items, conflict with core
  • Reverter History menu Alt-Y - 1 item (!) maybe move to File?
  • CzechAddress Alt-Z - 5 items, maybe join with Cadastre-fr an other possible cadastre/adress tools like FixAddress, HouseNumbers, etc.?

We still have some non-menu Alt keys. It may not be a trouble, but if keys are needed...

  • Alt-A, Alt-S = add/edit property, core, ok
  • Alt-X = split object (utilsplugin2) (useful) Alt-J (unjoin)
  • Alt-J = extract point with history (utilsplugin2, mine addition) - rather rare
  • Alt-R = RoadSigns, RoutingDialog (conflicts)
  • Alt-T = CzechAddress, AddressFactory (conflicts with tools menu)

comment:68 in reply to:  67 ; Changed 8 years ago by stoecker

Replying to akks:

  • TrustOsm ALT-B - 1 item (!)
  • WalkingPapers ALT-K - 1 item (!)
  • Conflation, newly added, ALT-R, 1 item (!) (conflict)
  • Reverter History menu Alt-Y - 1 item (!) maybe move to File?

These should be moved to other menus.

Maybe we should split Tools in the core into "Tools" and "Drawing" (better name?), where Drawing only contains stuff directly related to drawing, and Tools everything else.

comment:69 in reply to:  68 Changed 8 years ago by akks

Replying to stoecker:

These should be moved to other menus.

Maybe we should split Tools in the core into "Tools" and "Drawing" (better name?), where Drawing only contains stuff directly related to drawing, and Tools everything else.

I like the idea. But what should we place in new menu on clean JOSM?
Aren't all items in default Tools menu related to drawing? We have additional menu "More tools" in Utilsplugin2, and almost all of them are for drawing/tagging too... (3 for tagging, 2 for opening custom URL).

comment:70 in reply to:  68 ; Changed 8 years ago by bastiK

Replying to stoecker:

Replying to akks:

  • TrustOsm ALT-B - 1 item (!)
  • WalkingPapers ALT-K - 1 item (!)
  • Conflation, newly added, ALT-R, 1 item (!) (conflict)
  • Reverter History menu Alt-Y - 1 item (!) maybe move to File?

These should be moved to other menus.

For these, I'd prefer a toplevel menu "Plugins". Each plugin gets a submenu, which contains at least one item "Info". The Info dialog would contain a short how-to, i.e. where to find the commands, mapmodes, toggledialogs and other features that are provided by the plugin.

Plugins
 |- UtilsPlugin2
      |- Info
      |---------
      |- Remove
 |- Reverter Pugin
      |- Revert Changeset
      |---------
      |- Info
      |---------
      |- Remove
 |----------
 |- Configure Pluings       (Opens 'Plugins' tab in the Preferences (F12))

comment:71 in reply to:  70 ; Changed 8 years ago by stoecker

Replying to bastiK:

For these, I'd prefer a toplevel menu "Plugins". Each plugin gets a submenu, which contains at least one item "Info". The Info dialog would contain a short how-to, i.e. where to find the commands, mapmodes, toggledialogs and other features that are provided by the plugin.

No Info-descriptions in code. For this we have the wiki. I'm happy f.e. the shortcut stuff is gone now. And a "About plugin" entry will be outdated fast, so it makes no sense as well.

But a plugins menu is a good idea I think.

Regarding Tools: Someone proposed to group Actions into "Node", "Way", "Relation" and "Combined". This way the actions could be grouped according to their usage. Probably this will work (except we would have to move everything in combined group).

comment:72 in reply to:  71 ; Changed 8 years ago by skyper

Replying to stoecker:

Replying to bastiK:

For these, I'd prefer a toplevel menu "Plugins". Each plugin gets a submenu, which contains at least one item "Info". The Info dialog would contain a short how-to, i.e. where to find the commands, mapmodes, toggledialogs and other features that are provided by the plugin.

No Info-descriptions in code. For this we have the wiki. I'm happy f.e. the shortcut stuff is gone now. And a "About plugin" entry will be outdated fast, so it makes no sense as well.

But a plugins menu is a good idea I think.

Think there exist already a ticket about this issue.

I do not think it is useful to have submenus for every plugin, especially if the submenus will only contain one entry.

Regarding Tools: Someone proposed to group Actions into "Node", "Way", "Relation" and "Combined". This way the actions could be grouped according to their usage. Probably this will work (except we would have to move everything in combined group).

We could also only show the menu entries which work with the current selection.

comment:73 in reply to:  70 Changed 8 years ago by akks

Replying to bastiK:

Replying to stoecker:

Replying to akks:

  • TrustOsm ALT-B - 1 item (!)
  • WalkingPapers ALT-K - 1 item (!)
  • Conflation, newly added, ALT-R, 1 item (!) (conflict)
  • Reverter History menu Alt-Y - 1 item (!) maybe move to File?

These should be moved to other menus.

For these, I'd prefer a toplevel menu "Plugins". Each plugin gets a submenu, which contains at least one item "Info". The Info dialog would contain a short how-to, i.e. where to find the commands, mapmodes, toggledialogs and other features that are provided by the plugin.

"Plugins" menu have some problems

  • Nested menus are usable only for rare actions. Users and plugin developers can become unhappy (
  • Some plugins are basic tools for certain mappers (cadastres, videomapping, ...)
  • If flat menu - there are plugins with ~10 menu items to put then in single menu.
  • We have no menu preferences to allow users change it.

I prefer logically grouped menus with plugin actions on bottom after separator and one extra flat menu (plugins? more tools? something else? - which suite better). But it will be hard to group actions conveniently. Maybe we can intoduce "Tagging" menu for example...

Replying to skyper:

We could also only show the menu entries which work with the current selection.

Will not it be too resource consuming on machines with small screens? This can become useful option, but it can confuse user if turned on by default.

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

comment:74 in reply to:  71 Changed 8 years ago by akks

Replying to stoecker:

But a plugins menu is a good idea I think.

Regarding Tools: Someone proposed to group Actions into "Node", "Way", "Relation" and "Combined". This way the actions could be grouped according to their usage. Probably this will work (except we would have to move everything in combined group).

This will help to sort only Tools and half of Utilsplugin2. We should have a place to put selectors, downloaders, tag-modifcators, etc... Combined? And walkingPapers, Lake Walker, etc...
So my curnent ideas are

  • Leave plugins with big menus as is.
  • Add "Selection" menu in core (select all, unselect all) to be extended by Utilsplugin2 and other selectors.
  • Add "more tools" analog in core, prefill it with some tools actions - for modificators of tags/geometry.
  • Add menu like "Data" for plugin reverting, exporting, importing, working with signatures, cadastre etc.
  • Add Plugins submenu to Help where show plugin icons and launch their help on click (to learn what you installed). Maybe add context menu "Uninstall", "Configure", if it is possible.
Last edited 8 years ago by akks (previous) (diff)

comment:75 Changed 8 years ago by rickmastfan67

Hey guys, just wanted to mention some new really weird conflicts I just got tonight after upgrading to r4991. Had 6 conflicts that all were "resolved" to the same shortcut.

Silent shortcut conflict: 'tools:licensechange' moved by 'tools:createcurve' to 'Ctrl+Alt+F1'.
Silent shortcut conflict: 'subwindow:licensechange' moved by 'subwindow:layers' to 'Ctrl+Alt+F1'.
Silent shortcut conflict: 'system:movefocusright' moved by 'microsoft-reserved-13' to 'Ctrl+Alt+F1'.
Silent shortcut conflict: 'system:movefocusleft' moved by 'microsoft-reserved-14' to 'Ctrl+Alt+F1'.
Silent shortcut conflict: 'system:movefocusup' moved by 'microsoft-reserved-16' to 'Ctrl+Alt+F1'.
Silent shortcut conflict: 'system:movefocusdown' moved by 'microsoft-reserved-15' to 'Ctrl+Alt+F1'.

This also showed up, but not 100% sure it's related:

Keystroke ctrl alt pressed F1 is already assigned to org.openstreetmap.josm.plugins.licensechange.CheckAction@7f371a59, will be overridden by org.openstreetmap.josm.gui.dialogs.ToggleDialog$ToggleDialogAction@4f0e98d8

Here's my build info:

Repository Root: http://josm.openstreetmap.de/svn
Build-Date: 2012-02-19 02:32:14
Last Changed Author: Don-vip
Revision: 4991
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
URL: http://josm.openstreetmap.de/svn/trunk
Last Changed Date: 2012-02-19 02:46:48 +0100 (Sun, 19 Feb 2012)
Last Changed Rev: 4991

Identification: JOSM/1.5 (4991 en)
Memory Usage: 332 MB / 2730 MB (58 MB allocated, but free)
Java version: 1.6.0_31, Sun Microsystems Inc., Java HotSpot(TM) 64-Bit Server VM
Operating system: Windows 7
Dataset consistency test: No problems found

Plugin: OpeningHoursEditor (27676)
Plugin: buildings_tools (27676)
Plugin: imageryadjust (27744)
Plugin: licensechange (27676)
Plugin: mapdust (27596)
Plugin: measurement (27464)
Plugin: openstreetbugs (27355)
Plugin: reverter (27676)
Plugin: turnrestrictions (27857)
Plugin: undelete (27649)
Plugin: utilsplugin2 (27859)
Last edited 8 years ago by rickmastfan67 (previous) (diff)

comment:77 Changed 8 years ago by stoecker

In 4993/josm:

see #7226 - fix shortcut reassignment

comment:78 Changed 8 years ago by Don-vip

In 4994/josm:

see #7226 - fix microsoft-reserved-13 to microsoft-reserved-16 shortcut conflicts

comment:79 in reply to:  76 Changed 8 years ago by stoecker

comment:80 Changed 8 years ago by skyper

Please guys be careful with asigning Ctrl+Alt+*. Why do not just use Ctrl+Alt+Backspace or Ctrl+Alt+Print+B ?

For real:

If we do not have more key combinations left we might have to think about time-period sequences like the activation of layers.

Last edited 8 years ago by skyper (previous) (diff)

comment:81 Changed 8 years ago by akks

I can gladly take Ctrl- and Shift-backspace for my Utilplugins2 features(select modified nodes, select mofified ways, undo selection) if some need Shift-Z, Ctrl-Alt-Z, Alt-Shift-Z :)

comment:82 in reply to:  80 ; Changed 8 years ago by stoecker

Replying to skyper:

Please guys be careful with asigning Ctrl+Alt+*. Why do not just use Ctrl+Alt+Backspace or Ctrl+Alt+Print+B ?

Reserved combinations are now also in the overview list.

comment:83 Changed 8 years ago by akks

Wow - JOSM 5001 became a real monster! I have just compiled and installed all plugins together and the only warnings given by JOSM are

Silent shortcut conflict: 'properties:edit' moved by 'menu:Scripting' to 'Ctrl+Alt+F1'.
Keystroke shift ctrl alt pressed R is already assigned to org.openstreetmap.josm.gui.dialogs.ToggleDialog$ToggleDialogAction@1504f9f, will be overridden by org.openstreetmap.josm.gui.dialogs.ToggleDialog$ToggleDialogAction@40728c

(except toolbar action warnings).

P.S. Oh, sorry - I did not notice 5002 and updated plugin jars. I was trying to fix compilation on jdk7 and remove annoying exception stacktraces when all is ok.

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

comment:84 Changed 8 years ago by stoecker

except toolbar action warnings

They should be fixed as well. Please open a ticket with them.

comment:85 in reply to:  82 Changed 8 years ago by skyper

Replying to stoecker:

Replying to skyper:

Please guys be careful with asigning Ctrl+Alt+*. Why do not just use Ctrl+Alt+Backspace or Ctrl+Alt+Print+B ?

Reserved combinations are now also in the overview list.

Please, add for unix:

  • Ctrl+Alt+PLUS and Ctrl+Alt+MINUS -> xserver mode change
  • Ctrl+Alt+PRINTSCREEN+* -> kernel syskeys
  • Ctrl+Alt+F11 and Ctrl+Alt+F12 -> screen:toogle

Thanks

comment:86 in reply to:  72 Changed 8 years ago by skyper

Replying to skyper:

Replying to stoecker:

Replying to bastiK:

But a plugins menu is a good idea I think.

Think there exist already a ticket about this issue.

#6355

comment:87 Changed 8 years ago by skyper

Ticket #6341 and #6952 have been marked as a duplicate of this ticket.

Last edited 8 years ago by skyper (previous) (diff)

comment:88 Changed 8 years ago by skyper

Ticket #6309 has been marked as a duplicate of this ticket.

comment:89 Changed 8 years ago by simon04

I'm very unhappy with the new "Download from OSM..." shortcut, which was introduced in r4966. I use(d) this shortcut frequently while mapping/testing. Now it is no longer possible to press this shortcut with the left hand, and requires to move the right hand from the mouse to the cursor keys. At the moment it may be faster to click the toolbar icon. To conclude, I'd strongly favor to restore the old mapping or an adequate shortcut.

comment:90 Changed 8 years ago by akks

Now you can place it even on D in shortcut preferences, if you use download very often...

comment:91 Changed 8 years ago by simon04

I know how to remap this shortcut locally, but I expect more users to download via the OSM API frequently. :-)

comment:92 Changed 8 years ago by simon04

Ticket #6492 has been marked as a duplicate of this ticket.

comment:93 Changed 8 years ago by skyper

Ticket #3278 has been marked as a duplicate of this ticket.

comment:94 Changed 8 years ago by akks

Problem: F1 shortcut is unchangeable (you can set action for it, but help will continue to work - without any warnings).
When line

Shortcut.registerSystemShortcut("system:help", tr("reserved"), VK_F1, 0);                            // Display Help

is removed, this problem vanish, but I am not sure this is right approach.

comment:95 in reply to:  91 Changed 8 years ago by stoecker

Replying to simon04:

I know how to remap this shortcut locally, but I expect more users to download via the OSM API frequently. :-)

Actually there is no noise on JOSM bug tracker or even talk and talk-de groups, so I see no reason to change shortuct mappings again. Obviously only a few people use the changed shortcuts intensively.

comment:96 in reply to:  94 Changed 8 years ago by stoecker

Replying to akks:

Problem: F1 shortcut is unchangeable (you can set action for it, but help will continue to work - without any warnings).

This is a bug in shortcuts settings. You can double assign a shortcut (even to system keys). These double assignments will then be resolved on next load depending on the priority (system key, user assignment, other keys). JOSM should warn in configuration stage already.

comment:97 Changed 8 years ago by akks

In 5355/josm:

Allowing to change F1 help shortcut on Windows, see #7226

comment:98 Changed 8 years ago by akks

I hope last changeset does not introduce bugs. Some people like to map their favourite actions on F1-F10 very much...

Oops - are we in stabilization phase or it has finished with r5335 ?

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

comment:99 in reply to:  98 Changed 8 years ago by skyper

Replying to akks:

I hope last changeset does not introduce bugs. Some people like to map their favourite actions on F1-F10 very much...

Oops - are we in stabilization phase or it has finished with r5335 ?

New tested was releasied but still in stabilization.

comment:100 Changed 8 years ago by akks

Ok, I'll be careful (no more patches are ready anyway).

comment:101 Changed 8 years ago by Don-vip

Stablization should end on Monday if nothing major has arisen meanwhile :)

comment:102 Changed 7 years ago by akks

Here are only current conflicts Plugin vs Core:

  • Scripting plugin uses Alt-S for 'menu:Scripting' (conflicts with properties:edit)
  • SDS plugin (not in list) uses Alt-S for 'menu:SDS' (conflicts with properties:edit)

comment:103 Changed 7 years ago by stoecker

Resolution: fixed
Status: newclosed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain stoecker.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.