Keyboard Shortcut

I am trying to assign the special character U+2500 to a keyboard shortcut like <Alt+.>but I am not having any success.

Also, I am having trouble assigning a macro to a keyboard shortcut.

I am trying to follow all of the Online Help instructions, but it’s just not working for me.

LongHyphen

1 Like

In the status bar at the bottom of your document window does it show the language that you expect or normally use, such as English (USA)?

Click Tools > AutoCorrect > AutoCorrect Options > Options. In the dialogue is Replace dashes ticked? See Options (AutoCorrect) for how dashes are replaced.

English Sentence Checking in the Options dialogue has a grammar check for En dash and Em dash

In AutoCorrect for English USA the shortcut for En dash (–) is :--: and Em dash (—) is :---:. You could add an entry to Autocorrect for Box drawings Light horizontal (─) U+2500 such as :_:

Note that Box drawings Light horizontal is intended for programs to draw boxes and might cause accessibility issues in text.

1 Like

I don’t think you can do so.

There is an old extension “Compose Special Characters” which allows to define shortcuts for special characters, but mostly using it you will have to hit 3 keys and then a confirming combination to get the wanted result.

If your LibreOffice is sufficiently recent, you can type the four-digit-unicode followed by a Alt+X to get the respective character, and this works reversely helping to memorize the few needed codes.

For the example you gave you can type 2500Alt+X and using different codes you can get most of actually used unicode characters without defining lots of shortcuts.

The solution works in Writer, but also in Calc, and even in shape texts (also in Draw) and in the Math formula editor. Try it!

1 Like

I see that En Dash works but Em Dash doesn’t work, although it is listed in Tool>AutoCorrect>AutoCorrect Options.

The 2500Alt+x does work as suggested by Lupp. However, saving the character to the Special Character, Favorites menu is easy too. The icon is not in Calc but 2500Alt+x does work in Calc.

I wonder why Em Dash doesn’t work but En Dash does?

En dash is U+2013 while Em dash is U+2014 so when used with Alt+X they are just as convenient.

I think the important thing about AutoCorrect is this table from Help:

Text that you type: Result that you get:
A - B (A, space, minus, space, B) A – B (A, space, en-dash, space, B)
A – B (A, space, minus, minus, space, B) A – B (A, space, en-dash, space, B)
A–B (A, minus, minus, B) A—B (A, em-dash, B)
N–N (N, minus, minus, N) N–N (N, en-dash, N)
A-B (A, minus, B) A-B (unchanged)
A -B (A, space, minus, B) A -B (unchanged)
A --B (A, space, minus, minus, B) A –B (A, space, en-dash, B)

English Sentence checking can also be used but it is not instant
EnglishSentenceEmDash


A further option is AutoText add the Em dash with a shortcut of em and then in your text you enter em then key F3

1 Like

Got it! Word1,nospace,dash,dash,nospace,Word2 makes an Em Dash. Using spaces after Word1 and before Word2 makes an En Dash.

Thanks!

image

1 Like

If the intent is to insert and En Dash or an Em Dash while typing, the solution is:

En Dash: Word,space,dash,dash,space,Word
Em Dash: Word,nospace,dash,dash,nospace,Word

image

1 Like

Just to make it clear once again in this thread:

  • U+2500 is neither an em dash nor an en dash or any dash. It is the LIGHT HORIZONTAL line from the BOX DRAWINGS group of unicode.
  • The unicode for the En Dash is U+2013, and for the Em Dash U+2014

Personal suggestion: Don’t use special tools like Favourite Characters or AutoCorrect (which soon can become an AutoMessUp) or AutoText for the simple cases of inserting a single character. You would again need to memorize a lot and to hit mostly 3 or more keys (or modified keys) when applying the specially defined settings.
Use the very handy and more general Alt+X feature instead, and avoid waisting “short shortcut names” needed when resorting to one of the other mentioned tools.

Having forgotten a specially defined shortcut or experiencing a malfunction you will need a research based on your personal settings. Having forgotten a unicode, simply ask your favourite search engine - or find an example in your text, place the cursor behind it and hit Alt+X there. You get shown th forgotten code, and a second Alt+X reinstates the character itself.

4 Likes

Very helpful information. Thank you.