Opened 2 years ago
Last modified 2 years ago
#22377 new defect
Allow shortcuts to be conditionally enabled
Reported by: | mariotomo | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Core shortcuts | Version: | |
Keywords: | Cc: |
Description
in my workflow, I tend to use the mouse as little as possible, and I don't like moving it around too much.
this plugin has the rather intuitive shortcut Shift-A that, while I'm in the MapWithAI layer, and I have a non empty selection, will move the selection to the underlying Data Layer, and activate that layer, to let me fine tune the new imported objects.
the above is fine, what's less nice is that I need the mouse to go back to the MapWithAI layer. The Shift-A shortcut is still in place also in the Data Layer, even if it doesn't make sense and the event is ignored.
I suppose that you could make sure that the Shift-A function is limited to the MapWithAI layer, and that in the Data Layer it is as without the plugin. or you could redefine the effect to going back to the MapWithAI layer, which would also make sense.
Attachments (0)
Change History (2)
comment:1 by , 2 years ago
Component: | Core → Plugin mapwithai |
---|---|
Owner: | changed from | to
comment:2 by , 2 years ago
Component: | Plugin mapwithai → Core shortcuts |
---|---|
Owner: | changed from | to
Summary: | Shift-A shortcut is not available in Data Layer → Allow shortcuts to be conditionally enabled |
I don't think there is an easy way to conditionally enable a shortcut based off of specific conditions, unfortunately. I wish there was, and that might help alleviate shortcut conflicts in JOSM (see wiki:DevelopersGuide/ShortcutsList).
You can use the
{
/}
shortcuts to go through layers instead, or change the shortcut for MapWithAI add to something other thanshift
+a
. If you can come up with an intuitive shortcut that doesn't conflict, please let me know.Anyway, if shortcuts can be conditionally enabled, we would probably need to do the following:
onLayerChange
/onFocusGained
/etc.).Anyway, I might be able to hack around it by checking to see if I am in the
MapWithAILayer
, and if not, pass it to theActivateLayerAction
.