OK I've dug around a little.

The keyboard shortcuts in node tool, for example Ctrl+A for select all, and Ctrl+H to toggle handle's visibility, are "hard coded" in the source code -- at least that is what it looks like to me.

Simplest possible fix would be to repeat the code row from align-and-distribute.cpp which performs the actual vertical- or horisontal node alignment, and hard-coding the keyboard shortcuts in root_handler of node-tool.

1. Is my assumption that these in-tool shortcuts are hardcoded correct?

2. If it is, is the Control+Alt+T and Control+Alt+H suggested by C R OK with others? To me "Control+Alt+V" makes more sense than "H" as V and H stands for Vertical- and Horisontal flip when selecting objects.
Suggestion: Re-use the V, H key pair in this context too. There does not seem to be a collision in node tool for these at least.

3. I'd prefer not hard-coding the keyboard shortcuts, and instead having them as defaults to be modifiable by user. How hard is that to achieve?

4. I love the status bar info of Inscape -- would that be the right place to "document" these shortcuts? Or rather on tooltips of the buttons? Or somewhere else? What about keyboard shortcut documentation?





Mvh


/Olof
-----------------
3-5-åriga småttingar i närheten?
Lek & lär siffror och bokstäver via mobilen m.h.a. Alfamem till Android.


On 10 March 2016 at 23:57, Marc Jeanmougin <marc@...3062...> wrote:
It just means that the button press itself will be unavailable if there
is no dialog.

But when you press the button, what's called is the ActionNode (line
351) which has a conveniently named "on_button_click" method, which
calls distributeNodes or alignNodes depending on which button the user
pushed.

And those functions are submethods of "nt" which is, very conveniently,
the node tool (where we want to activate the kb shortcuts) (that just
means they can only work when the node tool is active, which is normal
since it's the only tool where we have a selection of nodes).

--
Mc

On 03/10/2016 10:47 PM, Olof Bjarnason wrote:
> Thank you Marc, that's a great start...
>
> I read through the dialog .cpp file, and found the addNodeTool method,
> which is used to build up the node alignment buttons. I noticed there is
> a member _actionList, that is cleared/deleted in the AlignAndDistribute
> destructor - does that mean the actions/operations are only available if
> the alignment dialog is open/visible to the end user?
>
> If that is the case, it's a bit annoying, as I'd like keyboard shortcuts
> to be available to me regardsless of whether a certain dialog is open or
> not. I'd say as soon as the node tool is active, the Ctrl+Alt+T/H node
> alignment shortcuts should be available. C R agree?
>
> We could take the discussion off-list if you think it's too noicy.
>
> On 10 Mar 2016 22:15, "Marc Jeanmougin" <marc@...3062...
> <mailto:marc@...3062...>> wrote:
>
>     Sure, what do you need ?
>
>     How I would proceed :
>
>     1/ find the functions associated with those buttons(I'd look at the
>     align dialog (in src/ui/dialog/align-and-distribute.cpp), and find
>     something related to nodes)
>
>     2/ find the root handler for node tool (in src/ui/tools/node-tool.cpp)
>
>     3/ look at how the other keyboard shortcuts are handled there, and add a
>     check for those shortcuts, with the function found in (1) as effect
>
>     --
>     Mc
>
>     On 03/10/2016 09:52 PM, Olof Bjarnason wrote:
>     > I'd like to help out in this one if I may ...
>     >
>     > But I've only added some unit tests to lib2geom so far, and would need
>     > some guidance to the Inkscape source code.
>     >
>     > Anyone care to be my "mentor" for this task...?
>     >
>     > Regards,
>     >
>     > On 10 Mar 2016 21:04, "C R" <cajhne@...400...
>     <mailto:cajhne@...400...> <mailto:cajhne@...400...
>     <mailto:cajhne@...400...>>>
>     > wrote:
>     >
>     >     Ctrl-Alt-T - Align selected nodes Horizontal to eachother.
>     >     Ctrl-Alt-H - Align selected nodes Vertical to eachother.
>     >
>     >     Quickie, but would really help in making diagrams and quick edits
>     >     within a shape.
>     >
>     >     -C
>     >
>     >
>      ------------------------------------------------------------------------------
>     >     Transform Data into Opportunity.
>     >     Accelerate data analysis in your applications with
>     >     Intel Data Analytics Acceleration Library.
>     >     Click to learn more.
>     >     http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140
>     >     _______________________________________________
>     >     Inkscape-devel mailing list
>     >     Inkscape-devel@lists.sourceforge.net
>     <mailto:Inkscape-devel@lists.sourceforge.net>
>     >     <mailto:Inkscape-devel@...2181...eforge.net
>     <mailto:Inkscape-devel@lists.sourceforge.net>>
>     >     https://lists.sourceforge.net/lists/listinfo/inkscape-devel
>     >
>     >
>     >
>     >
>     ------------------------------------------------------------------------------
>     > Transform Data into Opportunity.
>     > Accelerate data analysis in your applications with
>     > Intel Data Analytics Acceleration Library.
>     > Click to learn more.
>     > http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140
>     >
>     >
>     >
>     > _______________________________________________
>     > Inkscape-devel mailing list
>     > Inkscape-devel@lists.sourceforge.net
>     <mailto:Inkscape-devel@lists.sourceforge.net>
>     > https://lists.sourceforge.net/lists/listinfo/inkscape-devel
>     >
>
>
>     ------------------------------------------------------------------------------
>     Transform Data into Opportunity.
>     Accelerate data analysis in your applications with
>     Intel Data Analytics Acceleration Library.
>     Click to learn more.
>     http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140
>     _______________________________________________
>     Inkscape-devel mailing list
>     Inkscape-devel@lists.sourceforge.net
>     <mailto:Inkscape-devel@lists.sourceforge.net>
>     https://lists.sourceforge.net/lists/listinfo/inkscape-devel
>