Shortcut for button "Resize page to drawing or selection"
Shortcut for button "Resize page to drawing or selection"
Very short question, is there a shortcut for the button "Resize page to drawing or selection" (accessible from File → Document Properties, and then click the arrow in front of "Resize page to content...")?
Re: Shortcut for button "Resize page to drawing or selection
it's not in the keys reference afaik.
customizing toolbars has been on the radar for quite a while..wonder if it's not too far on the horizon.
customizing toolbars has been on the radar for quite a while..wonder if it's not too far on the horizon.
Re: Shortcut for button "Resize page to drawing or selection
Do we really need a shortcut for every action ?
I never used this function and if I got to use it, I think I'll need it only once (before saving), don't I ?
Do you process batch of files to need this shortcut ?
I never used this function and if I got to use it, I think I'll need it only once (before saving), don't I ?
Do you process batch of files to need this shortcut ?
Re: Shortcut for button "Resize page to drawing or selection
Ailurus wrote:Very short question, is there a shortcut for the button "Resize page to drawing or selection" (accessible from File → Document Properties, and then click the arrow in front of "Resize page to content...")?
The verb already exist:
Code: Select all
$ inkscape --verb-list | grep FitCanvas
FitCanvasToSelection: Fit the page to the current selection
FitCanvasToDrawing: Fit the page to the drawing
FitCanvasToSelectionOrDrawing: Fit the page to the current selection or the drawing if there is no selection
You only have to add a keymapping for it (Inkscape doesn't ship with predefined keyboard shortcuts for each available verb). Save the following code
Code: Select all
<?xml version="1.0"?>
<keys name="Inkscape default">
<!-- Fit the page to the current selection -->
<bind action="FitCanvasToSelection" />
<!-- Fit the page to the drawing -->
<bind action="FitCanvasToDrawing" />
<!-- Fit the page to the current selection or the drawing if there is no selection -->
<bind key="F" modifiers="Ctrl,Alt,Shift" action="FitCanvasToSelectionOrDrawing" />
</keys>
[1] The location depends on your platform:
on linux/osx:
Code: Select all
~/.config/inkscape/keys/default.xml
Code: Select all
%APPDATA%\inkscape\keys\default.xml
Re: Shortcut for button "Resize page to drawing or selection
Very helpful, thanks! For future purposes, is there any way to see whether a specific keyboard shortcut is already in use?
Re: Shortcut for button "Resize page to drawing or selection
Ailurus wrote:Very helpful, thanks! For future purposes, is there any way to see whether a specific keyboard shortcut is already in use?
Inkscape doesn't create a (dynamic) list of keyboard shortcuts in-use - when launching, it loads and parses key-mapping files from two locations: the shared one which gets installed with Inkscape (same for all users), and the one from the current user inkscape profile (if present). Shortcuts redefined in the user key-mapping file will override those in the shared file.
Your best bet to find free key/modifier combinations is to search in the shared file:
- on linux, usually
Code: Select all
/usr/share/inkscape/keys/default.xml
- on OS X, it's inside the application bundle:
Code: Select all
/Applications/Inkscape.app/Contents/Resources/keys/default.xml
- on Windows, the shared resources are installed into the program folder Inkscape was installed to.
You can also consult the online keyboard and mouse reference, or browse the files in the the source code repositories ( development branch / 0.48.x branch ).