Frequently asked questions - Writer
TDF LibreOffice Document Liberation Project Community Blogs Weblate Nextcloud Redmine Ask LibreOffice Donate
How to allocate a keyboard shortcut to a special character
The menu
▸ ▸ allows you to allocate a shortcut only to the actual launching of the ▸ command.There are however three different ways to obtain the desired result.
Using AutoCorrection
- go to ▸ ;
- enter in the Replace box the characters that you want to replace by the special character; and
- right-click in the With box, then choose Special character and select the character you want (it is also possible to paste this character in if it is present on the clipboard).
Note: AutoCorrection requires that the text to be replaced be "isolated" by preceding and following spaces at the time of capture.
Creation of an AutoText
- insert the special character into a document
- select the character and go to ▸
- choose the category in which the AutoText will be stored (My AutoText for example)
- give it a name and a shortcut
- click on the AutoText button followed by New and
- close the dialog
Note: As with AutoCorrection, the capture of the "shortcut" should in principle be preceded and followed by spaces in order that the code be recognised. AutoText however permits this limitation to be overridden by selecting the shortcut before hitting the F3 key (cf. the note in this FAQ).
Using a macro
It is possible to record the insertion of a character in a macro (menu [1]. Then allocate the macro to the keyboard shortcut concerned.
▸ ▸ ) without requiring any particular knowledge of programming.The advantages of this solution of allocating a macro to a keyboard shortcut are:
- the insertion is effectively bound to the shortcut: it is not necessary to insert "replacement" text (AutoCorrection or AutoText); and
- the shortcut can be defined for several modules.
Example of a recorded macro:
sub InsertCharSpec
rem ----------------------------------------------------------------------
rem define variables
dim document as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ----------------------------------------------------------------------
dim args1(1) as new com.sun.star.beans.PropertyValue
args1(0).Name = "Symbols"
args1(0).Value = "©"
args1(1).Name = "FontName"
args1(1).Value = "Times New Roman"
dispatcher.executeDispatch(document, ".uno:InsertSymbol", "", 0, args1())
end sub
Notes:
- ↑ If this command is not available, you will need to activate it by using ▸ ▸ ▸ ▸ or from version 4 by ▸ ▸ ▸