Opened 22 months ago

Last modified 21 months 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:


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 skyper, 21 months ago

Component: CorePlugin mapwithai
Owner: changed from team to taylor.smock

comment:2 by taylor.smock, 21 months ago

Component: Plugin mapwithaiCore shortcuts
Owner: changed from taylor.smock to team
Summary: Shift-A shortcut is not available in Data LayerAllow 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 than shift+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:

  1. Indicate that the shortcut is context sensitive if any conflict depends upon context.
  2. All context sensitive shortcuts must not start out in an enabled state, and instead must use the context to determine if they are enabled or not (i.e., 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 the ActivateLayerAction.

Modify Ticket

Change Properties
Set your email in Preferences
as new The owner will remain team.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from team to the specified user.
Next status will be 'needinfo'. The owner will be changed from team to mariotomo.
as duplicate The resolution will be set to duplicate. Next status will be 'closed'. The specified ticket will be cross-referenced with this ticket.
The owner will be changed from team to anonymous. Next status will be 'assigned'.

Add Comment

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