I am so used to using CTRL-+ and CTRL-- as zoom-in/zoom-out that it really annoys me when an application does not use these shortcuts. LibreOffice is one that does not.
How can I globally re-assign CTRL-+ and CTRL-- as zoom-in/zoom-out?
I am so used to using CTRL-+ and CTRL-- as zoom-in/zoom-out that it really annoys me when an application does not use these shortcuts. LibreOffice is one that does not.
How can I globally re-assign CTRL-+ and CTRL-- as zoom-in/zoom-out?
ctrl + mouse pad up/down is the default to do this. I know that this is not an answer to your question, but knowing this satisfied me when I had this same issue
This is my first post. Feel free to provide feedback if need be.
TL/DR: Create macros. Assign key bindings.
Here’s a work-around that accomplishes the goal of zooming in and out with the keyboard. The only catch is that not only are the built in “Zoom In” and “Zoom Out” commands broken, but it appears the “Ctrl + -” and “Ctrl + +” key bindings are broken as well (I couldn’t assign any command to those key bindings successfully). I ended up choosing to use “Ctrl + 9” for zooming out and “Ctrl + 0” for zooming in as those key bindings felt as close to the key bindings I was going for as I could get. Here’s what to do:
First, add the macros. Here are the two I created:
Sub ZoomIn
Dim doc As Object
Dim new_zoom_value As Integer
Dim dispatcher As Object
doc = ThisComponent.CurrentController.Frame
new_zoom_value = ThisComponent.CurrentController.viewSettings.ZoomValue + 5
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dim args1(2) as new com.sun.star.beans.PropertyValue
args1(0).Name = "Zoom.Value"
args1(0).Value = new_zoom_value
args1(1).Name = "Zoom.ValueSet"
args1(1).Value = 28703
args1(2).Name = "Zoom.Type"
args1(2).Value = 0
dispatcher.executeDispatch(doc, ".uno:Zoom", "", 0, args1())
End Sub
Sub ZoomOut
Dim doc As Object
Dim new_zoom_value As Integer
Dim dispatcher As Object
doc = ThisComponent.CurrentController.Frame
new_zoom_value = ThisComponent.CurrentController.viewSettings.ZoomValue - 5
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dim args1(2) as new com.sun.star.beans.PropertyValue
args1(0).Name = "Zoom.Value"
args1(0).Value = new_zoom_value
args1(1).Name = "Zoom.ValueSet"
args1(1).Value = 28703
args1(2).Name = "Zoom.Type"
args1(2).Value = 0
dispatcher.executeDispatch(doc, ".uno:Zoom", "", 0, args1())
End Sub
In short, the macros grab the current zoom value as a percentage, add or subtract 5 percentage points, then assign the new zoom value. You can alter the percentage that the macros zoom in or out by, by altering the number at the end of the “new_zoom_value” line.
To add the macros open the IDE (Tools → Macros → Edit Macros) and past the above code into “Module1”:
Next, to assign the key bindings:
Here’s what it looks like AFTER clicking “Modify” but before clicking “OK”:
Note that if you go back and look at the custom key bindings in the dialogue box, the macros will show up as a line of OpenOffice.org Basic code rather than the names you assigned them but they still work just the same.
I hope this helps!
Hello, whenever I try the shortcuts I get a “Property or Method not found”. I just started using Calc, can you get me any info on what I might be doing wrong? It would be thoroughly appreciated.
It sends me back to the Macro window in this line “new_zoom_value = ThisComponent.CurrentController.viewSettings.ZoomValue + 5”
Hello, whenever I try to do this a message box appears and sends me back to the macro window with the text: “BASIC runtime error” “Property or method not found: viewSettings.” and the selected text in the Macros is: “new_zoom_value = ThisComponent.CurrentController.viewSettings.ZoomValue - 5”. Any help would be much appreciated, I just switched to Calc a couple of days ago because Excel was too restrictive for my needs.
This seems to be the only solution that works in 7.1, even with the mentioned shortcuts (Ctrl±)
This is still broken in 5.1.6.2.
The shortcut can be modifed but they don’t take effect (tried restart application).
In LO-4.4.4 + LO-5.0.0 you can assign those functions to those keys via the Customise dialog. One of the LO apps needs to be open before you take the steps below:
- (
menu
):Tools
→Customise
→Keyboard
tab
In
Shortcut Keys
:-
- select
Ctrl++
(by default assigned to ‘Calculate’)
Delete
button to remove default assignmentIn
Functions
:-
- select
Category
→View
Function
→Zoom In
LibreOffice
option-button to apply to all of LOWriter
, or whichever App is open)Modify
button to apply the Function to the KeyOK
to apply the shortcutZoom Out
If this helps then please tick the answer ()
Does not work in Localc/Lowriter 4.2.8.2.
Try giving a little more info; it encourage others to want to help you.
As you gave your LO version I added some extra info at the top of my reply.
I upgraded to 5.0.3.2. It still does not work. I can set the keys, but nothing happens after I press OK, and press CTRL-+ or CTRL–. I had expected the Zoom percentage in the lower right corner to change, just like it does if I do CTRL-scrollwheel.
Doesn’t work in 7.1.Worked for a while on version 7.0.6 for Linux, now it doesn’t. As said in another answer, it works in print preview. By the way, for zoom in Ctrl+= is more consistent on a US keyboard.
the aparent bug is still going in 6.0.5!.
found some information about this. there is a bugzilla thread:
https://bugs.documentfoundation.org/show_bug.cgi?id=45705&redirected_from=fdo
wich states that that the shortcuts you can assing in Tools-customize-keyboard dialog correspond to the preview mode.
Browsing the options at Writer: Tools-Cusomize-keyboard-Category=view there are many possibly related Functions.
100%,150%,200%,50%,75%,Optimal,Zoom, Zoom In, Zoom Next, and others. One of the ‘Zoom’ options acutally opens a zoom dialog that makes it possible to select a zoom level pressing a second shortcut. a shortcut at PageWidth also works.
Its not the solution, but this workaround makes the thing workable
EDIT , the day after.
in Libreoffice Draw, the following works:
to make this work in writer and calc would be of great help. maybe combining the keys with ctrl or super.
As a complement to the answer that worked for me, which provides a macro, I want to post here an image with the location of the settings - under Tools - Customize - Keyboard (tab) - Category: LibreofficeMacros (drop-down) - My Macros (drop-down) -Module1
Tested in Linux with LO 7.1.