[josm-dev] Commit access

Henry Loenwind henry at loenwind.info
Mon Oct 6 17:01:57 BST 2008


Dirk Stöcker wrote:
> On Sun, 5 Oct 2008, Henry Loenwind wrote:
> 
> I found no way to register a shortcut using a modifier. Did I overlook 
> anything. I wanted to removed the F1/F1 clash and make the About dialog 
> into Shift+F1.

There is no way to register a modifier. That would defeat the whole 
point about being platform-independent. The code that registers a 
shortcut should not know about what modifiers the user's keyboard has at 
all.

Also, there is no need to work around clashes other than change the 
ordering of the registerShortCut() calls so that they are in a logical 
order. So the Action for Help registers first, the one for About second. 
What modifiers they will get comes from the platform dependent setup and 
can be changed by the user (for 4 of the groups).

There is a way to enforce secondary or tertiary modifiers, but I would 
not recommend to use it for normal cases. I allowed it only to 
facilitate having 2 shortcuts on the same level by default (Download and 
Upload), and I consider it a "hack".

>> the old binding will only be used to see if a warning should be shown or

> Then something does not work as expected. I should get the same silent 
> changes on each call. From call to call there are a lower number of these.

No, you'll get each warning only once. A silent (==conole) one for 
shortcuts the user has not been exposed before (that's new shortcuts), 
or a popup window for shortcuts the user could have already used.

So if you start JOSM for the first time, you'll get a list of silent 
warnings. Thereafter you won't get any warning unless either:

* You change a shortcut so there's a conflict (popup)
* You install a plugin that has conflicting shortcuts (silent or popup)
* You install a new JOSM that has new shortcuts (silent or popup)

>>> c) The list is not sorted in any way I find useful.
>> It's not sorted at all. Nor is it filtered. Nor do the column have
>> useful widths.
> 
> They must be sorted. It is hard to use as it is now.

Correct.

 >> ...

> This is fine internal. Copy that text into the code if not already there.

I think there is a shorter text. I'll update that.

> Don't expose that or the ID to the user. The description and the shortcut 
> should be the only visible thing in the user menu. Giving sensible 
> descriptions is much better than having 3 descriptional types.

I agree for the id. I just wanted to have it there at the beginning.

> Is there really a reason for the key modifier panel after we fixed the 
> clashing shortcuts? If not, this and probably the informational text 
> should only be visible, when a certain secret variable is set (e.g. 
> shortcut.modifiers=true :-).

Frederik requested it.

Also, please remember that you cannot "fix" clashes unless you know the 
keyboard setups of all systems JOSM could run. And that's impossible 
because we support plugins for new systems.

You are not even expected to do so, thats what the automatic conflict 
resolver is there for. Ok, we can tweak it a little so the default on 
the "big 3" operating systems looks sensible, but that's as far as I 
think we should go.

BTW: If you force About to Ctrl-F1 to avoid the conflict with Help on 
F1, you'll re-introduce a nice platform-dependency. For OSX-Users About 
will then also be on Ctrl-F1, where it would have been on F1 by default. 
(And Cmd-F1 as first fallback and Shift-Cmd-F1 as second fallback). --- 
"system:help" is Cmd-? on OSX (once I find out how to bind "?" from Java)...

> Do you make a patch for the above points and send it to me?

I'll work through my TODO-list as I've got spare time, sure. I'd prefer 
to attach the patches to a new trac-ticket, but I can notify you by mail 
if you want.

BTW: I'm not quite sure what to do about shortcuts registered by plugins 
that are not currently loaded. I could auto-kill them, but what if the 
user just disabled the plugin for a moment? Then his shortcuts may jump 
around, and his user-configured shortcuts may vanish, too. Maybe I 
should add an on-demand tab to the shortcut configuration: "The unglue 
plugin is not loaded. Click [here] to remove its shortcuts from the 
configuration."?

cu
Henry




More information about the josm-dev mailing list