Shortcut customization going bananas

Post questions on how to use or achieve an effect in Inkscape.
pingo08
Posts: 3
Joined: Sun Oct 07, 2012 12:40 pm

Shortcut customization going bananas

Postby pingo08 » Sun Oct 07, 2012 1:11 pm

Hello

I'm having trouble personalizing my keyboard shortcuts on Inkscape. Please give me your thoughts...

1. How do I disable the quick zoom feature? It seems to be hardcoded; I would like to map something to the Q key but Quick Zoom overrides everything. The action seems absent from verbs.cpp and I rewrote my default.xml from scratch anyway so I see no way Quick Zoom could have slipped in accidentally. A walk through Inkscape's preferences yielded no light either.

2. "Ctrl+A" appears to be glued to "EditSelectAll" (not vice-versa, though). Because I like to keep my selection commands on the Shift key, the following XML leads to both Ctrl+A and Shift+A selecting everything in the current layer (even though there's no Ctrl):

Code: Select all

<bind key="a" modifiers="Shift" action="EditSelectAll" display="true" />
<bind key="A" modifiers="Shift" action="EditSelectAll" />

3. Much like in the previous issue, comma and period seem to be hardcoded into shrinking and enlarging the currently selected object.

As I wrote the previous sentence I realized shrinking and growing only make sense when the :tool_selector: tool is active, and as I test it now I see that in fact the shortcut is only overriden under that condition. So the tool is expected to overwrite shortcuts? :S
Maybe that has something to do with issue 2 also?

4. Neither single-quote symbol (`, ´) seem to ever do anything. The back quote is assigned to zoom history by default as stated in http://inkscape.org/doc/keys046.html, and I guess that means it has proved to work, so I might be alone in this. I've tried setting the following names (minus GDK_KEY_) to no avail (from gdkkeysyms.h): GDK_KEY_apostrophe, GDK_KEY_quoteright, GDK_KEY_quoteleft, GDK_KEY_asciicircum, GDK_KEY_grave, GDK_KEY_asciitilde, GDK_KEY_acute, GDK_KEY_dead_tilde and GDK_KEY_dead_circumflex.

Using:
- A US keyboard.
- Tried both the "English (US)" and the "English (US, international with dead keys)" keyboard layouts.
- Ubuntu 12.04 wearing gnome classic with no effects (I guess these can intercept shortcuts or something).
- Inkscape 0.48.

Here's a simplified default.xml file that summarizes all of the above, for testing:

Code: Select all

<?xml version="1.0"?>
<keys name="Test">

   <!-- 1st issue; Inkscape ignores these and execs Quick Zoom when the Q key is pressed. -->
   <!-- Expected behavior: The ToolPen tool activates. -->
   <!-- Actual behavior: Temporal zoom-in. -->
   <bind key="q" action="ToolPen" display="true" />
   <bind key="Q" action="ToolPen" />

   <!-- 2nd issue; These fail to replace Ctrl+A. Shift+A behaves as expected though. -->
   <!-- Expected behavior: Shift+A selects everything in the current layer, Ctrl+A activates the ToolPen. -->
   <!-- Actual behavior: BOTH Shift+A and Ctrl+A select everything in the current layer. -->
   <bind key="a" modifiers="Shift" action="EditSelectAll" display="true" />
   <bind key="A" modifiers="Shift" action="EditSelectAll" />
   <bind key="a" modifiers="Ctrl" action="ToolPen" />
   <bind key="A" modifiers="Ctrl" action="ToolPen" />

   <!-- 3rd issue; this does nothing when the Select tool is active. -->
   <!-- Expected behavior: The ToolPen tool activates. -->
   <!-- Actual behavior: The currently selected object shrinks or grows. -->
   <bind key="comma" action="ToolPen" display="true" />
   <bind key="period" action="ToolPen" display="true" />

   <!-- 4th issue: I can't get tildes/apostrophes to work at all. -->
   <!-- Expected behavior: Either tilde on the keyboard should activate the ToolPen. -->
   <!-- Actual behavior: Nothing happens. -->
   <bind key="apostrophe" action="ToolPen" />
   <bind key="quoteright" action="ToolPen" />
   <bind key="quoteleft" action="ToolPen" />
   <bind key="asciicircum" action="ToolPen" />
   <bind key="grave" action="ToolPen" />
   <bind key="asciitilde" action="ToolPen" />
   <bind key="acute" action="ToolPen" />
   <bind key="dead_tilde" action="ToolPen" />
   <bind key="dead_circumflex" action="ToolPen" />

   <!-- These are here just to show that the problem is not ToolPen. If I delete it, the problems above persist. -->
   <bind key="p" action="ToolPen" display="true" />
   <bind key="P" action="ToolPen" />

</keys>

I've sorted the problems from most important to whatever. Issue 1 renders Inkscape almost unusable to me due to Q's location :S. I mean just saying in case this is going to steal too much of your time.

Thank you.

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: Shortcut customization going bananas

Postby ~suv » Tue Oct 09, 2012 11:12 pm

pingo08 wrote:1. How do I disable the quick zoom feature? It seems to be hardcoded; I would like to map something to the Q key but Quick Zoom overrides everything. The action seems absent from verbs.cpp and I rewrote my default.xml from scratch anyway so I see no way Quick Zoom could have slipped in accidentally. A walk through Inkscape's preferences yielded no light either.
The Quickview command is hard-coded and does not use verbs - you cannot remap it without editing the source code and recompiling inkscape yourself.
pingo08 wrote:2. "Ctrl+A" appears to be glued to "EditSelectAll" (not vice-versa, though). Because I like to keep my selection commands on the Shift key, the following XML leads to both Ctrl+A and Shift+A selecting everything in the current layer (even though there's no Ctrl):
If you edit a user keymap file, the default 'Ctrl+A' is still in effect, until you redefine it to execute a different verb. The user keymap file does not replace the system one installed with Inkscape - it is parsed in addition to the shared one (i.e. it can override keymappings, and can add new ones, but not simply remove the ones defined in the shared keymap file).
At the same time, 'Ctrl+a' also seems to be hard-coded in 'select-context.cpp' (see next item).
pingo08 wrote:3. Much like in the previous issue, comma and period seem to be hardcoded into shrinking and enlarging the currently selected object.
AFAIK those are hard-coded shortcuts, too (i.e. not based on verbs), and cannot be redefined at runtime.

pingo08
Posts: 3
Joined: Sun Oct 07, 2012 12:40 pm

Re: Shortcut customization going bananas

Postby pingo08 » Fri Oct 12, 2012 4:21 am

The Quickview command is hard-coded and does not use verbs - you cannot remap it without editing the source code and recompiling inkscape yourself.

At the same time, 'Ctrl+a' also seems to be hard-coded in 'select-context.cpp'.

AFAIK those are hard-coded shortcuts, too (i.e. not based on verbs), and cannot be redefined at runtime.

(Issues 1, 2 and 3)
Wow, thank you so much for the directions through the source! Compiling Inkscape ended up being lengthier than I expected, but everything works beautifully now.
From what I know it works as expected with "standard" en_US keyboard layouts. Did you verify the keysyms as seen by X on your system with 'xev' (in an xterm)? The command 'xev' allows to see which key on the keyboard actually sends which keysym.

(Issue 4)
Lol, how do you people get to know this kind of stuff? Finally a brute-forceless way to guess keys! :D .
Still, I get keysyms 0x27 and 0x60 (apostrophe and grave) and they still avoid my Inkscape :/.
are you really using Inkscape 0.46?

No, sorry. I was just reading the wrong documentation.

Thanks!


Return to “Help with using Inkscape”