Author Topic: User defined shortcuts for node manipulators  (Read 1514 times)

July 26, 2017, 11:16:38 PM
Read 1514 times

migy2

  • Sr. Newbie

  • Offline
  • **

  • 2
Greetings Inkscape community from Germany,  :wave:

I am using Inkscape for a while now and now I am searching for an answer for my issue.

My problem:
After using Inkscape a couple of times, I found out, that I always use the same commands. To make life easier I wanted to redefine the keyboard shortcuts. Some of them are fine (via "Preferences->Interface->Keyboard Shortcuts" or by using the default.xml as mentioned on the Inkscape website), but some existing shortcuts can't be changed with this method.
For me:
There is a button saying "Delete segment between two non-endpoint nodes" :bbn: in the Edit paths by nodes menu :node:. As mentioned in the manual there is a shortcut for this manipulator
Quote (selected)
Del+Alt
Is it possible to redefine this shortcut to another key combination like let's say Y+Alt due I am using this action quite often.
What I tried (could be totaly wrong  :@@:) was to add a new line to default.xml saying:
Quote (selected)
  <bind key="Y" modifiers="Alt" action="NodeDeleteSegmentAction" display="true" />
using the action NodeDeleteSegmentAction.

Current setup:
Win7
Inkscape 0.92

I hope you can help me.  :)
Thanks you all!

July 26, 2017, 11:30:47 PM
Reply #1

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Welcome to the forum!

Indeed, you can assign your own shortcuts for many commands.  See Edit menu > Inkscape Preferences > Interface > Keyboard Shortcuts.  It's not entirely obvious how to use it.  So if you need a hint, let us know  :)  (I tend not to use key shortcuts, so not very familiar.)
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

July 26, 2017, 11:46:36 PM
Reply #2

migy2

  • Sr. Newbie

  • Offline
  • **

  • 2
Thanks for the suggestion brynn, but it seems like you missunderstood my problem.  :wink1:
The shortcut I am talking about is not listed there.
Could be one of the shortcuts you cannot change like it is mentioned on https://inkscape.org/de/doc/keys092.html
Quote (selected)
Some of the keyboard shortcuts may not be available for non-US keyboard layouts, but most (not all) of these shortcuts are configurable by the user

July 29, 2017, 12:45:07 PM
Reply #3

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Oh, sorry about that. 

As I said, I'm not very familiar with key shortcuts.  I noticed that there are a few more XML files for key shortcuts (in Inkscape Preferences).  I guess none of those provides an option?

Is the problem that the current shortcut can't be changed?  Or is it that what you wanted to change it to, doesn't work?  Did you discover that yet?

I've tried reading the info at the top of share/keys/default.xml.  But I get stuck where it says to find a particular file in the source code.  So I can't find the actions/verbs which are possible (because I don't know where to find the source code).

But for the action= part, in the code that you reported adding to default.xml, it seems like a lot of words, compared to all the other shortcuts in default.xml.  I wonder, instead of "NodeDeleteSegmentAction" if it should be "NodeDeleteSegment"?  None of the others have "Action" on the end of the action= part.

This part might not matter as much.  But for the part that says:

Quote (selected)
- The "display" attribute controls whether this binding will be displayed in the menu and tooltips. Only one binding for each action may have this attribute.

I probably wouldn't be worried to much about whether the shortcut would be displayed.  Because there's not a menu item for that particular item anyway.  And as long as you know the shortcut that's needed, it wouldn't matter whether the tool tip was correct or not.  So if taking "Action" out of "NodeDeleteSegmentAction" doesn't make it work, I guess I would try taking out the "display=true" part, in case that might be blocking it from working somehow.

Hhmm.... "Only one binding for each action may have this attribute."  I can't quite understand that.  I'm trying to understand how an action (which if it means "verbs" it would be similar to a "command") and how could a single one need more than 1 key binding.  But it seems to be instructional, if I could understand it.
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

July 31, 2017, 01:03:57 PM
Reply #4

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Hey, I just read that the next new version (0.92.2) will allow more special character for user-defined shortcuts!  0.92.2pre0 is already available, if you'd like to try it  :)  (see link above)
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann