Hi, I'll keep my introduction short: my name it's Gianluigi Scarpa and I'm just learning how to use Inkscape.
I should admit that the mine it's a minor problem, still I would like to go through the official tutorials in a neat way and I'm experiencing a difficulty at using the Grave Accent "`" to go back to a previous zoom level.
I cannot find an answer to my question neither in this forum nor on the net.
Last, but not least I'm using a MacBook with X11, so it would be very helpful if the eventual answers would be related to this OS.
Thanks to everyone
Previous zoom feature of Grave/Acute Accent
-
- Posts: 3
- Joined: Wed Jun 24, 2009 11:58 pm
Re: Previous zoom feature of Grave/Acute Accent
I'm not a Mac user, but I vaguely remember discussion about keyboard shortcuts on Macs. Try doing a Google search with "site:www.inkscapeforum.com" as a part of your search term and you might be able to find it. Also try the FAQ on the Inkscape Wiki.
Re: Previous zoom feature of Grave/Acute Accent
In my experience this is an issue with non-querty keyboard layouts. Some of the standard keys used for Inkscape keyboard shortcuts can only be reached with a modfier key (Shift or Option) which in turn might trigger a different shortcut command.
I assume you have a qwertz-layout with special characters related to Italian? You can reassign most of the predefined keyboard shortcuts by creating a user keymap file.
On OS X 10.5.7:
1) open the inkscape application package (right click on 'Inkscape'... in the Finder) and navigate to 'Contents/Resources/keys'. Copy the file 'default.xml'
2) navigate to your user configuration folder for Inkscape: Finder menu 'Go > Go to Folder…', enter
for v0.46 or for 0.46+devel/0.47pre0Now create a folder called 'keys' if it doesn't exist and paste the file 'default.xml' into the folder 'keys'.
3) quick fix: Open default.xml with TextEdit, search for the line withand modify the shortcut key to your needs.
4) better: rename the pasted copy of 'default.xml' to 'default.txt', open it and read the explanation in the first part of the document. Now create a new, empty 'default.xml' and add only those keyboard shortcuts you want to override. Thus you can update Inkscape without fear of missing important changes regarding keymap and at the same time keep your personal (i.e. changed) shortcuts. Your new minimal 'default.xml' could like like this:
but you have to figure out new (currently unused) keys yourself ;-)
hth, ~suv
ps. Just in case you use 0.46: I have never used 0.46 myself, so I do hope this really works the same way as in newer versions...
I assume you have a qwertz-layout with special characters related to Italian? You can reassign most of the predefined keyboard shortcuts by creating a user keymap file.
On OS X 10.5.7:
1) open the inkscape application package (right click on 'Inkscape'... in the Finder) and navigate to 'Contents/Resources/keys'. Copy the file 'default.xml'
2) navigate to your user configuration folder for Inkscape: Finder menu 'Go > Go to Folder…', enter
for v0.46
Code: Select all
~/.inkscape
Code: Select all
~/.config/inkscape
3) quick fix: Open default.xml with TextEdit, search for the line with
Code: Select all
<bind key="grave" action="ZoomPrev" display="true"/> <!-- ` -->
4) better: rename the pasted copy of 'default.xml' to 'default.txt', open it and read the explanation in the first part of the document. Now create a new, empty 'default.xml' and add only those keyboard shortcuts you want to override. Thus you can update Inkscape without fear of missing important changes regarding keymap and at the same time keep your personal (i.e. changed) shortcuts. Your new minimal 'default.xml' could like like this:
Code: Select all
<?xml version="1.0"?>
<keys name="Inkscape default">
<!-- personal keyborad shortcut overrides -->
<!--
this is a comment
-->
<!-- Zoom -->
<!-- your shortcuts follow -->
<bind key="grave" modifiers="Shift" action="ZoomNext" display="true"/> <!-- ` -->
<bind key="asciitilde" modifiers="Shift" action="ZoomNext" /> <!-- ~ -->
<bind key="grave" action="ZoomPrev" display="true"/> <!-- ` -->
<!-- don't forget to close the keys tag -->
</keys>
hth, ~suv
ps. Just in case you use 0.46: I have never used 0.46 myself, so I do hope this really works the same way as in newer versions...
-
- Posts: 3
- Joined: Wed Jun 24, 2009 11:58 pm
Re: Previous zoom feature of Grave/Acute Accent
Sorry for the late answer and feedback, anyway I've a QWERTY keyboard and I tried all of these possible solutions, but still nothing. I went on and I did some pretty cool works with Inkscape, but I've no solution to this issue.
Re: Previous zoom feature of Grave/Acute Accent
Ok, I forgot to check the Italian keyboard layout (Preferences > Input Menu) on my MBP 15.4".
I'll attach a sample default.xml that maps 'Zoom previous' to the dollar sign '$' left of the 'enter' key, and the 'Zoom next' shortcut to the asterisk '*' (= Shift + $). Put the file into '~/.inkscape/keys' (for 0.46) or '~/.config/inkscape/keys' (for 0.46-devel and 0.47pre).
Then restart Inkscape, select the 'Zoom' tool and try if these new key mappings work ($ for 'Zoom previous, * for 'Zoom next').
attaching the file was denied - adding it inline:
Make sure that there are no leading spaces in the first line, otherwise inkscape might not recognze it as legitimate xml formatted file.
I'll attach a sample default.xml that maps 'Zoom previous' to the dollar sign '$' left of the 'enter' key, and the 'Zoom next' shortcut to the asterisk '*' (= Shift + $). Put the file into '~/.inkscape/keys' (for 0.46) or '~/.config/inkscape/keys' (for 0.46-devel and 0.47pre).
Then restart Inkscape, select the 'Zoom' tool and try if these new key mappings work ($ for 'Zoom previous, * for 'Zoom next').
attaching the file was denied - adding it inline:
Code: Select all
<?xml version="1.0"?>
<keys name="Inkscape default">
<!-- personal keyboard shortcut overrides -->
<!-- Zoom -->
<!-- your shortcuts follow -->
<bind key="asterisk" modifiers="Shift" action="ZoomNext" display="true"/> <!-- * -->
<bind key="dollar" action="ZoomPrev" display="true"/> <!-- $ -->
<!-- don't forget to close the keys tag -->
</keys>
Make sure that there are no leading spaces in the first line, otherwise inkscape might not recognze it as legitimate xml formatted file.
-
- Posts: 3
- Joined: Wed Jun 24, 2009 11:58 pm
Re: Previous zoom feature of Grave/Acute Accent
@~suv: My last reply wasn't entirely correct: I knew your solution worked, but I could only make it work with keys that I took away from other shortcuts listed in the file because I don't know the xml right spelling of symbols' names. Can you tell me how to make it work with "\" and "|" which replace the grave and the tidle on the macBook keyboard?
Thanks
Thanks
Re: Previous zoom feature of Grave/Acute Accent
These character names seem to stem from the X11 world (but I didn't yet verifiy that & google for an annotated list) - I used an xterm and the command 'xev' to figure out the previous two (dollar, asterisk)...
output for '/', '|' and '\':
so my first tests would use 'bar' for '|' and 'backslash' for '\'. But the real problem are the modifiers - especially 'Option/Alt'. On my MBP '|' and '\' are not on the same key when switching to the Italian keyboard layout and at first sight I can't even find the 'bar' key, with none of the (combined) modifiers - probably because MB ≠ MBP?
Keyboard shortcuts that need the modifier 'Option' never worked on my laptop (physical keyboard layout 'de_CH'), except where the 'Alt+' is defined as mod anyway (all menu calls: 'Alt+f' for 'File', 'Alt+e' for 'Edit' etc.) but not without remapping the 'Option' key in X11 as well (with '~./Xmodmap': left option key -> 'Alt_L', right option key stays 'Mode_switch'):
Q: can you toggle the guides with |? I can't because '|' is typed with Option + 7, and the Option keypress event gets eaten by inkscape before it is recognized as part of the key mapping and then inkscape thinks I pressed 7 and does nothing ;-(
hth, ~suv
output for '/', '|' and '\':
Code: Select all
KeyRelease event, serial 29, synthetic NO, window 0xa00001,
root 0x1fd, subw 0x0, time 1578206814, (-152,74), root:(489,213),
state 0x1, keycode 34 (keysym 0x2f, slash), same_screen YES,
XLookupString gives 1 bytes: (2f) "/"
XFilterEvent returns: False
KeyPress event, serial 29, synthetic NO, window 0xa00001,
root 0x1fd, subw 0x0, time 1578209918, (-152,74), root:(489,213),
state 0x2000, keycode 34 (keysym 0x7c, bar), same_screen YES,
XLookupString gives 1 bytes: (7c) "|"
XmbLookupString gives 1 bytes: (7c) "|"
XFilterEvent returns: False
KeyPress event, serial 29, synthetic NO, window 0xa00001,
root 0x1fd, subw 0x0, time 1578217262, (-152,74), root:(489,213),
state 0x2001, keycode 34 (keysym 0x5c, backslash), same_screen YES,
XLookupString gives 1 bytes: (5c) "\"
XmbLookupString gives 1 bytes: (5c) "\"
XFilterEvent returns: False
so my first tests would use 'bar' for '|' and 'backslash' for '\'. But the real problem are the modifiers - especially 'Option/Alt'. On my MBP '|' and '\' are not on the same key when switching to the Italian keyboard layout and at first sight I can't even find the 'bar' key, with none of the (combined) modifiers - probably because MB ≠ MBP?
Keyboard shortcuts that need the modifier 'Option' never worked on my laptop (physical keyboard layout 'de_CH'), except where the 'Alt+' is defined as mod anyway (all menu calls: 'Alt+f' for 'File', 'Alt+e' for 'Edit' etc.) but not without remapping the 'Option' key in X11 as well (with '~./Xmodmap': left option key -> 'Alt_L', right option key stays 'Mode_switch'):
Code: Select all
LeWitt:~ suv$ xmodmap -pm
xmodmap: up to 2 keys per modifier, (keycodes in parentheses):
shift Shift_L (0x40), Shift_R (0x44)
lock Caps_Lock (0x41)
control Control_L (0x43), Control_R (0x46)
mod1 Alt_L (0x42), Mode_switch (0x45)
mod2 Meta_L (0x3f), Meta_R (0x47)
mod3
mod4
mod5
Q: can you toggle the guides with |? I can't because '|' is typed with Option + 7, and the Option keypress event gets eaten by inkscape before it is recognized as part of the key mapping and then inkscape thinks I pressed 7 and does nothing ;-(
hth, ~suv
Re: Previous zoom feature of Grave/Acute Accent
Gianluigi Scarpa wrote:... because I don't know the xml right spelling of symbols' names. Can you tell me how to make it work with "\" and "|" which replace the grave and the tidle on the macBook keyboard?
how to figure out X11 KeySym definitions:
- local Inkscape resource: inside the Inkscape.app package:
'Contents/Resources/keys/default.xml' - Inkscape key map definition (using X11 KeySym names) in trunk/src:
<http://inkscape.svn.sourceforge.net/viewvc/inkscape/inkscape/trunk/share/keys/default.xml?revision=21273&view=markup> - Inkscape gets them from gdk, which is part of GTK+:
<http://svn.gnome.org/viewvc/gtk+/trunk/gdk/gdkkeysyms.h?revision=22436&view=markup> - GTK+ takes them from the X11 include files:
<http://cgit.freedesktop.org/xorg/proto/x11proto/plain/keysymdef.h> - this file on your local mac (requires X11SDK or Xcode installed - both are on Leopard's installation DVD):
'/usr/X11/include/X11/keysymdef.h'Code: Select all
open -a TextEdit /usr/X11/include/X11/keysymdef.h
- command to display the current X11 KeySym definitions on your computer (in 'Terminal.app' or 'xterm'):(max.) 4 entries per KeyCode: no modifier - with 'Shift' - with 'Option' - with 'Shift + Option'
Code: Select all
xmodmap -pk
I don't know any tools to ease the next tedious steps: figure out which default keyboard shortcuts don't work, draft a new localized keymap plan for the essential shortcuts and implement it as user keymap file '~/.config/inkscape/keys/default.xml' (0.46+devel, 0.47).