compiling master list of keyboard shortcuts

Discussion about writing code for Inkscape.
User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

compiling master list of keyboard shortcuts

Postby brynn » Wed Aug 03, 2011 7:45 pm

Hi Friends (mostly ~suv and/or dvlierop),
I'm starting on the list of keyboard shortcuts, persuant to the discussion at the end of this topic: viewtopic.php?f=5&t=9860

Based on ~suv's comment:
What is needed IMHO is an outside view, tediously going through all tool contexts and actions, noting down what each modifier and each combination of modifiers does, as well as listing all hard-coded shortcuts within tool contexts which do not have an associated verb (i.e. can't be configured and customized in the 'keys/default.xml' file).

I want to create just such a list or lists. Since the configurable shortcuts are fairly well documented already, I'm starting there, and using both default.xml and http://inkscape.org/doc/keys048.html as guides.

This question is not vital for me to continue working, but I'm just curious. Here's a small screenshot of a section of default.xml:
Image
There are many items in the long list which start not with "bind key" but "bind action", and in my screenshot, "<bind action="SelectPrefs"/>". Are these simply actions (verbs?) for which there is no key binding? Because I see that all the other items that start with "bind key" also do have an "action". Are they listed here because the developers hope to assign them a key binding at some point? Or otherwise, why are they listed there?

Thanks for your help :D

User avatar
druban
Posts: 1917
Joined: Fri Nov 20, 2009 10:48 pm

Re: compiling master list of keyboard shortcuts

Postby druban » Thu Aug 04, 2011 1:13 am

You can insert, between 'bind' and 'action' the key combination that you want to use, the developers have left some 'actions' without an assigned shortcut but as long as the verb exists you can make your own.
It would be nice if you could find out if there are any verbs out there that are coded in but not in the keys.xml file! (I would be particularly happy for a verb to show/hide the palette or the snap toolbar!)
Your mind is what you think it is.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: compiling master list of keyboard shortcuts

Postby brynn » Thu Aug 04, 2011 11:22 pm

Aaah, ok I understand. Thanks druban :D

druban wrote:It would be nice if you could find out if there are any verbs out there that are coded in but not in the keys.xml file! (I would be particularly happy for a verb to show/hide the palette or the snap toolbar!)

Well I'll be searching out the text string per dvlierop's instructions in the linked messages, which will reveal the hard coded keys. So if you could give me the proper text string to search for the verbs (and it's not ridiculously tedious) I would be glad to list those for you. ....wait....wouldn't there be like a bazillion verbs?

EDIT
I just found this in default.xml
- The "action" attribute contains the name of the action. The complete list of actions
(called "verbs") is in the file src/verbs.cpp in Inkscape source; there you can see
brief descriptions of what each action does. The same action may have multiple key
bindings.

Is that what you're looking for (src/verbs.cpp)?

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: compiling master list of keyboard shortcuts

Postby brynn » Fri Aug 05, 2011 12:23 am

Hi again,
Quick question. (edit - not so quick after all) Here's a screenshot of the beginning of my table. In the "modifiers and actions" columns, would it be better for me to use the exact language of the actions, i.e. - "FileNew" instead of "opens a new file" or "FileOpen" instead of "opens the selected file"? Or does that not really matter. I'm just not sure what kind of analysis is needed, or how it will be done. But I would want to make the data as useful as possible.

Image

Thanks, as always :D

EDIT
Screeeeech, apply the brakes!
Ok, I was thinking that each modifier would have a different affect, so that's why I made room for some text, besides just a checkmark in the cell. Because for example, Ctrl + drag with the Node tool does something different than Alt + drag. But I don't see those in default.xml. So now I'm thinking that for THIS table, the configurable shortcuts, all I need is a check mark in the cell, right?

So it will be in the source code where I'll find the modifiers which need a description? ......hmmm.....thinking further, when you use a key + a mouse action (click or drag) those aren't really keyboard shortcuts are they? Because in the case of Alt + drag with the Node tool, there's no other way to do that (known as sculpting nodes) Or Alt + click with Selection tool. "Shortcut" implies that there is another more time consuming way to do something. So in many cases, the use of keys in Inkscape isn't technically a "shortcut". Have I got that right? So would it maybe be more proper to refer to this as key mapping rather than key shortcuts?

Thanks again :D

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: compiling master list of keyboard shortcuts

Postby brynn » Tue Aug 16, 2011 7:45 pm

Ok, never mind. Still working :D

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: compiling master list of keyboard shortcuts

Postby brynn » Fri Aug 19, 2011 8:14 am

Hi again,
Ok, of course the more I learn, the more questions I have, lol.

This is about the number keys, and not about the keypad. From what I see at the moment, each have some action. I haven't gotten to the end yet, so I don't know if all the signs/symbols above the numbers have an action. But for the ones I've found far, let's use # as an example (toggles the grid). In order to type the number sign, you have to engage the Shift key. In default.xml, it shows the Shift key as a modifier. So I'm confused. Since the number sign requires the Shift key in the first place, why is Shift called a modifier?

Or maybe looking at it from a different perspective, why isn't it Shift + 3. That would seem to make more sense to me, because 3 has an action, and Shift + 3 has another. So it seems to me that the shortcut should either be # or Shift + 3. Or is this another one of the reasons why we need this sort of master list?

Thanks for your help :D

EDIT
Never mind again. I figured it out :mrgreen:

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: compiling master list of keyboard shortcuts

Postby brynn » Sun Aug 21, 2011 10:52 pm

Ok, when I said I figured out the last question, about the number keys, I didn't. Or maybe I only partly did.

Let me ask this -- Why are there 2 keys for each action. For example, r and R with Ctrl toggles the rulers. Or z and Z with Ctrl for Undo. At first, I thought it was for those who like to work with the Caps Lock on. Because that would make z or r automatically Z or R. But it turns out, I was confused. Here's a screenshot for the Linked Offset shorcut:
Image
(please ignore the black dot :oops: )
So see, Ctrl + Alt + j or J. Because if it could be just "j", that would free up "J" and all the keys. Then Shift + j (i.e. - J) could be used for something else.

So why is this?

Thanks for your help :D


Return to “Programming”