shortcut to toggle small capitals

I have been attempting to create a shortcut for toggling small capitals. Please note the requirement is for small capitals, not cycle case (Shift+F3). The requirement is for a single keystroke that will switch to small caps and switch back.

What I need:

  1. Hit shortcut (to select small capitals)
  2. Type my text in the editor
  3. Hit the same shortcut (to deselect small capitals)

Meanwhile, I must:

  1. Click Format
  2. Click Text
  3. Click Small Capitals to select
  4. Type my text in the editor
  5. Click Format
  6. Click Text
  7. Click Small Capitals to deselect

I was able to create a shortcut to enable small capitals, but it does not disable small capitals–I have to pick up my mouse to manually execute steps 5-7.

The lack of toggle seems like a bug to me, but perhaps I am misunderstanding the intended functionality or perhaps misunderstanding some terminology.

LibreOffice Version 6.0.7.3
Build ID: 1:6.0.7-0ubuntu0.18.04.10

edited by ajlittoz for better clarity of the lists

I’d call it a bug if function Small Capitals assigned to shortcut doesn’t toggle on/off Small Capitals. Just tested on my LibreOffice 6.4.6.2 version (packages from TDF) on openSUSE 15.2 and it exactly does this.

…tested on your configuration (LibreOffice Version 6.0.7.3 Build ID: 1:6.0.7-0ubuntu0.18.04.10) , and it does work for me as well. Hence I suspect a problem within your LibreOffice user profile. Could you check, if it does work in LibreOffice’s Safe Mode (Help -> Restart in Safe Mode;you would need to redefine the shortcut since Safe Mode runs with a temporary fresh user profile)?

Unfortunately the user-created keyboard shortcuts are not toggling.

However, if you accept to use Writer the way it should (no offence intended and all the more if you’re switching from M$ Word), you can workaround this difficulty and benefit from a huge improvement.

Writer is based on the use of styles. Styles are a set of formatting parameters grouped under a name. There are paragraph, character, frame, page and list styles. When you select a style, the parameters immediately apply to the object (paragraph, character, frame or page) selected. When there is no selection, it will apply to the subsequently typed characters (character style).

In your case, you need to create a character style for small capitals.

  • Show the style side pane with F11 or Styles>Manage Styles
  • Click on the second icon in the toolbar (the one with an A – character styles)
  • Right-click on the white area after the list and New
  • In the Organizer tab, give it a name like SmallCaps
  • In Font select a small cap font face or in Font Effects, Effects section, select Small capitals from the Case menu

After that, create a shortcut for this style in Tools>Customize, Keyboard tab, Category Styles>Character. Choose a free key and select your SmallCaps style.

As said above, user shortcuts are not toggling. Consequently, create another shortcuts for character style Default Style. CAUTION! There are also Default Style’s in paragraph and page categories. Take care to select the right one.

I recommend you download the Writer Guide and read the chapters about styles. This will give you clues to automate your typing.

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!

In case you need clarification, edit your question (not an answer which is reserved for solutions) or comment the relevant answer.

Unfortunately the user-created keyboard shortcuts are not toggling.

For me it does. Tested assigning shortcut CTRL+S to function Small Capitals and it toggles on/off.

This is because you assigned from Category Format. As a (stubborn) advocate of styles, I try to never use direct formatting. I described how to define a style and assign it a keyboard shortcut. Applying a style is never a toggling action.

I should have made my statement clearer. Apologies.

@ajlittoz: Are you talking of full-featured styles (also regarding all the attributes not under discussion here like FontSize, Weight …)? This can easily end up with needing hundreds of styles if a user insists to be able to apply small caps, and the like to bold / italic / whatever text in different font sizes and more… IMO there are too many attributes to allow for an absolutely strict insistence in the usage of styles in every case.
If you use character styles the overlaying way I described in my answer, you also cannot avoid to get “mixed ranges” and effects like with hard attributing.
Denying restrictions comes with complications… Alas!

@Lupp: my answer was beyond user strict requirement. I was already suggesting a consistent use of styles where the intent is not Small Caps per se but some semantic usage whose visible translation is small caps.

When you format your document with semantic markup in mind, a handful of paragraph styles plus hardly more character styles are enough. With such a small number of styles, each really frequently used style can be associated with a keyboard shortcut.

From the user point of view, it becomes as easy as direct formatting with the huge advantage of styling.

Customizing (>Tools>Customize...) you can add (make visible) the SmallCapitals attribute in your formatting toolbar, and you can also assign a shortcut to it. For me (now in V 7.0.0.,3) it works as a toggle.
In recent versions toolbars also offer a context menu item Visisble Buttons which helps to get the customization easier.

I would suggest you shift to thinking in styles insofar.
Using the Stylist (>Styles>Manage Styles - F11) and there the selecting icon Character Styles you wil find that the Default Character Style cannot be modified. That’s because it hasn’t any specific settings, but is supposed to be used as the mother of all overlaying styles.
Use it to create a new character style (>RightClick>New) smallCaps for which you do not set any attributes except >Font Effects>Effects>Small capitals.
If you now have written any text in any font with any style and/or hard attributes, you can select it in whole or parts and apply the overlay style smallCaps to it.
Try it and cheer!
From the new style smallCaps you can now derive a second overlay style, say withoutEffects by only changing the Small capitals effect to (without). Play with it and be happy.

Of course, there are reasons to design long-term documents and their templates without any locally applied effects whether by hard attributing nor by overlaid styles - which introduce another kind of hard attributes in a sense. For thoroughly restricted use-cases, however, the way I explained should be a highly efficient alternative.

===Edit 2020-08-29 about 17:30 UTC===
Adding to the answer and to my comment on another answer, I supply an example containing user code related to the question.
ask262984CharCaseMapSettings_1.odt