Ask Your Question
0

How can I create a keyboard shortcut for highlighting text in LO Writer?

asked 2019-09-20 02:01:53 +0100

tonyz gravatar image

I have set a custom KB shortcut under Tools -> Customize -> Keyboard but it isn't working. Any help would be appreciated.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2019-09-20 08:27:01 +0100

ajlittoz gravatar image

Highlighting text is not an "action" on text. It is an additional attribute on a character.

To achieve your goal, you must first define a character style with the specific colour selected as Background. Give a name to this style. You can now give it a keyboard shortcut.

This shortcut is not auto-toggling like Ctrl+B or I. I suggest you also associate a keyboard shortcut to character style Default Style so that you can cancel the effect of highlighting from the keyboard.

To show the community your question has been answered, click the ✓ next to the correct answer, and "upvote" by clicking on the ^ arrow of any helpful answers. These are the mechanisms for communicating the quality of the Q&A on this site. Thanks!

edit flag offensive delete link more

Comments

Thanks a lot @ajlittoz I followed your logic and it worked. I created a character style (corrected by your bold text since I had first created a paragraph style) then assigned it a shortcut. But to undo the highlighting, I created another character style calling it "Unhighlight" then assigned it a shortcut. I'm so happy to have this shortcut as it will save me much time when typing. Thank you very much. Unfortunately I can't upvote your answer since I have less than 5 points. All the same, you've been of great help.

tonyz gravatar imagetonyz ( 2019-09-21 12:34:41 +0100 )edit

CAUTION! Applying a style with forced highlighting "None" is not the same as having no character style applied. If you want to cancel your highlighting style, it is better to apply Default Stylecharacter style. It is not a real style. Its effect is to remove any character style to restore formatting state to the one defined in the current paragraph style. This is why I gave you this advice.

ajlittoz gravatar imageajlittoz ( 2019-09-21 13:11:15 +0100 )edit

Thanks for that. I've just implemented your advice and it works well. Strangely though, upon closing Writer, my shortcut is not saved. The name of the new character style is no longer displaying in the "Category" and "Function" boxes while the shortcut key in the "Shortcut Keys" box is replaced by a string which looks like a reference. Is there something I am doing wrongly? By the way this happened even before implementing your followup advice.

tonyz gravatar imagetonyz ( 2019-09-21 21:49:19 +0100 )edit

I tested it just now. The shortcut is kept after close/reopen as expected. My OS is Linux.

Shortcuts are stored in user profile. Path to it is hinted in Tools>Options, LibreOffice>Paths. Check that write permission is enable on the main directory and all others above it.

ajlittoz gravatar imageajlittoz ( 2019-09-22 08:37:59 +0100 )edit

I'm using Win 10 and I've seen that the new character style and its shortcut are saved with the open document. If I reopen the document used to create the new style, both the style and shortcut are present and working. If I open a new Writer document, the style is missing and the s/cut indicates a reference instead of the KB keys set for the shortcut. I'm thinking of creating a template which has the s/cut working and using that.

tonyz gravatar imagetonyz ( 2019-09-22 17:58:40 +0100 )edit

Custom styles are always stored in the document. It is intentional. I don't know for shorcuts and, effectively, I reopened the same document. Consequently, my test is not conclusive.

A template is the recommended way to ensure all documents will look the same. It is also an excellent idea to store shortcuts inside.

ajlittoz gravatar imageajlittoz ( 2019-09-22 19:39:56 +0100 )edit

You've been of great help. Thanks and God bless you.

tonyz gravatar imagetonyz ( 2019-09-22 19:45:45 +0100 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2019-09-20 02:01:53 +0100

Seen: 25 times

Last updated: Sep 20