Toggle dropper shortcut overrides keyboard definitions

Bug #180912 reported by Johncoswell
16
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Low
Christoffer Holmstedt

Bug Description

The toggle dropper shortcut (mapped to the "d" key) in event-context.cpp is overriding any keyboard verb definitions in use. This toggle call should instead be moved to verbs.cpp and mapped within the keyboard shortcut definitions files.

Related branches

Bryce Harrington (bryce)
Changed in inkscape:
importance: Undecided → Low
status: New → Confirmed
su_v (suv-lp)
tags: added: ui ui-shortcuts
Revision history for this message
Johncoswell (johncoswell) wrote :

If no one's going to complain, I'm going to go ahead and remove this feature. It's really getting on my nerves. I don't have commit access to the main branch, so I'll publish the change on a personal branch and refer to it here.

Revision history for this message
ScislaC (scislac) wrote :

Johncoswell,

You have commit access now. I just needed you LP username. :)

jazzynico (jazzynico)
tags: added: shortcuts
removed: ui-shortcuts
Revision history for this message
su_v (suv-lp) wrote :

'd' as keyboard shortcut is still hard-coded in current trunk (r12170):
<http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/view/12170/src/event-context.cpp#L589>

Changed in inkscape:
status: Confirmed → Triaged
tags: added: easy-fix
Revision history for this message
Christoffer Holmstedt (christoffer-holmstedt) wrote :

I have looked at the code and it seems like a bug I can fix. If I understood it correctly it's not just about removing hard-coding of "d" key but also adding it to verbs.cpp. I've found "ContextVerb" for the Dropper Tool already in verbs.cpp so maybe parts of this has been solved before.

Changed in inkscape:
assignee: nobody → Christoffer Holmstedt (christoffer-holmstedt)
status: Triaged → In Progress
Revision history for this message
su_v (suv-lp) wrote :

Finally getting around to dig out some additional context (sorry for being late with this):

Christoffer Holmstedt wrote on 2013-04-23:
> (…) I've found "ContextVerb" for the Dropper Tool already in verbs.cpp
> so maybe parts of this has been solved before.

1) Based on the old SVN history still available at sf.net, it appears that the verb for the dropper tool context was already defined in the initial commit for 'src/verbs.c':
<http://inkscape.svn.sourceforge.net/viewvc/inkscape/trunk/inkscape/src/verbs.c?view=log&pathrev=868>
and kept after partial C++ification in rev 869:
<http://inkscape.svn.sourceforge.net/viewvc/inkscape/trunk/inkscape/src/verbs.cpp?view=log&pathrev=10642>
<http://inkscape.svn.sourceforge.net/viewvc/inkscape/inkscape/trunk/src/verbs.cpp?view=log&pathrev=19921>
<http://inkscape.svn.sourceforge.net/viewvc/inkscape/inkscape/trunk/src/verbs.cpp?view=log&pathrev=20227>
<http://inkscape.svn.sourceforge.net/viewvc/inkscape/inkscape/trunk/src/verbs.cpp?view=log&pathrev=20240>
<http://inkscape.svn.sourceforge.net/viewvc/inkscape/inkscape/trunk/src/verbs.cpp?view=log&pathrev=22882>

2) The hard-coded 'D|d' keyboard shortcut appears to originate from this revision:
<http://inkscape.svn.sourceforge.net/viewvc/inkscape?view=revision&revision=16742>
as fix for
- Bug #170590 (sf1123529) “toggle key for dropper”
  <https://bugs.launchpad.net/inkscape/+bug/170590>

The proposed fix in the branch removes the special toggle feature of the dropper tool (toggles between any prior tool and the dropper tool) - the <space> toggle for tool switching still works, but always switches back to the select tool, not to the tool used before switching to the dropper.

<opinion>
Personally, I'm not sure which feature is to rate higher: having a configurable keyboard shortcut, or a special toggle feature for the dropper tool.
</opinion>

Revision history for this message
Christoffer Holmstedt (christoffer-holmstedt) wrote :

"<opinion>
Personally, I'm not sure which feature is to rate higher: having a configurable keyboard shortcut, or a special toggle feature for the dropper tool.
</opinion>"

@suv yea, was thinking about that as well. Really hard to tell I personally would like to have a configurable keyboard shortcut.

Is it perhaps possible to implement some kind of verb that remembers what was previously selected?

Revision history for this message
su_v (suv-lp) wrote :

Diff from new branch <lp:~christoffer-holmstedt/inkscape/lp180912-remove-hard-coded-toggle-dropper-keybinding> tested successfully on OS X 10.7.5 with Inkscape 0.48+devel r12379 (GTK+/X11 as well as GTK+/Quartz):

- the dropper keyboard shortcut still acts a special toggle between dropper and last used tool
- the toggle feature also works after assigning a custom keyboard shortcut to the dropper tool via 'Preferences > Interface': the newly defined custom keyboard shortcut also acts as toggle between dropper and last used tool.
- the original keyboard shortcut for the dropper tool (mapped to the "d" key) can be assigned to a different command, and is no longer overridden by a hard-coded definition.

Revision history for this message
Christoffer Holmstedt (christoffer-holmstedt) wrote :
Changed in inkscape:
status: In Progress → Fix Committed
su_v (suv-lp)
Changed in inkscape:
milestone: none → 0.49
Bryce Harrington (bryce)
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.