On 27-02-13 19:21, Alexandre Prokoudine wrote:
Hi,
Since 0.49 is shaping up so well with regards to polishing, I'd like to mention yet another thing. A while ago I discovered that several of our long-time users who have been with us since forever didn't even know that we have one-key shortcuts for tools. ... Since 0.49 now shows F* based shortcuts, how difficult would it be to patch it to show alternative shortcuts as well, after a "," character? Or would it be too confusing?
The original patch to add shortcuts to the labels was this: http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/revision/9745
From what I can tell, there would be a slight issue with showing the
alternative shortcuts as well, but it would be doable. Basically the issue is that primary shortcuts are indexed by verb, while alternative shortcuts are not (for those there is only an index from shortcut to verb).
Since shortcuts.cpp is pretty small and the indices (hash tables) are local to that file, it would definitely be doable to change it so that the table mapping verbs to primary shortcuts would become a table mapping verbs to a (double-ended) list of shortcuts (a std::deque or std::list for example), of which the first would be the primary shortcut. Given the small number of shortcuts that are typically associated with a single verb, it would even be acceptable (and likely preferable) to point to a simple std::vector rather than a std::list or std::deque.
In principle, the same could be done only for those shortcuts that have display=true. Those are currently considered primary, and if multiple "primary" shortcuts are defined for a single verb, we simply pick the last one. Instead, we could simply add them to a list.
In any case, once we have a table mapping verbs to lists of shortcuts it should be relatively trivial to alter sp_shortcut_get_label.
Disclaimer: I am not completely sure what the relevance is of having a "primary" shortcut, and am not sure what the repercussions are of slightly changing the semantics of "primary shortcuts". In particular, one should check where and how sp_shortcut_get_primary is used.