Bug 144560 - <Command>+R not customizable in LO Writer
Summary: <Command>+R not customizable in LO Writer
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.1.5.2 release
Hardware: All macOS (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:26.2.0
Keywords:
Depends on:
Blocks: Shortcuts-Mac
  Show dependency treegraph
 
Reported: 2021-09-16 21:03 UTC by Alexis
Modified: 2025-09-14 23:25 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Image file showing superficially assigned shortcut (400.76 KB, image/png)
2023-03-24 19:41 UTC, Alexis
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexis 2021-09-16 21:03:02 UTC
Expected behavior: Assigning <COMMAND>+R (Apple's command key and then the letter "R" key at the same time) to a working macro in LO 7.1.5.2 (for macOS 10.15.7) should trigger the macro when <COMMAND>-R is pressed.

Actual behavior: paragraph is aligned right.

Steps to reproduce:

1. Open a new Writer document.

2. Record a macro (e.g., to change the color of selected text to Red), save as "Red", and confirm that it works by selecting some text (e.g., black text) and running macro Red. Watch the text turn red. Yay.

3. Customize <COMMAND>+R to LibreOffice Macros > MyMacros > Standard > Module1 > Red using the Customize dialog. For extra giggles, be sure to customize Right (the RightPara one) to something else, like <COMMAND>+].

4. Select some text and type <COMMAND>+R: watch the paragraph in which the selected text is located shift to the right and NOT change to red-color text.

5. Tear your hair out for a bit. Recheck your various settings. Weep maybe. Then resign yourself to the fact that <COMMAND>-R is hard coded to RightPAra in LO 7.1.5.2


Comments 
(1) macOS 10.15.7 does NOT reserve <COMMAND>+R to this behavior.

(2) Above behavior is reproduced in LO 7.1.6.2.

(3) It IS possible to assign macro "Red" to another key, such as <CTRL>+R.

(4) I would love a list of all hard-coded keyboard shortcuts in LO, and for the customize dialog to automatically gray these out, or otherwise indicate that their settings will not be honored.
Comment 1 Alexis 2021-10-10 16:37:50 UTC
Bug recapitulated on macos Big Sur.
Comment 2 eisa01 2022-02-05 15:32:44 UTC
Was going to test this, but recording macros require Java which is not supported on ARM?
Comment 3 Alexis 2022-02-06 05:13:25 UTC
(In reply to eisa01 from comment #2)
> Was going to test this, but recording macros require Java which is not
> supported on ARM?

I am not sure what you are trying to communicate: my bug report is specific to macOS, and my Apple machine has an Intel processor, not Arm.
Comment 4 eisa01 2023-03-24 19:17:09 UTC
This is present

Version: 7.4.6.2 / LibreOffice Community
Build ID: 5b1f5509c2decdade7fda905e3e1429a67acd63d
CPU threads: 10; OS: Mac OS X 13.2.1; UI render: default; VCL: osx
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 5 Alexis 2023-03-24 19:41:13 UTC
Created attachment 186198 [details]
Image file showing superficially assigned shortcut
Comment 6 Alexis 2023-03-24 19:41:24 UTC
Bug is also present in LO 7.4.6.2 on macOS Monterey.

Additional comment: other keyboard shortcuts are apparently also hard coded. For example, I want to assign Writer > File > Export As… > Export Directly as PDF to <COMMAND>+<E>, but after doing so in Writer > Tools > Customize (see the attached image where the menu shows the shortcut 'assigned' as described), when I type <COMMAND>+<E> I get the default behavior of Justify Paragraph Centered.

Shortcut customization for macOS is somewhat broken, with undocumented hard-coded shortcuts (which are not hard-coded by the OS).
Comment 7 QA Administrators 2025-03-24 03:10:40 UTC Comment hidden (obsolete)
Comment 8 Neil Roberts 2025-09-08 10:28:49 UTC
I’ve tested this on git master (5c62e4ec31aa31e0bb) and the bug is still present.

You don’t need to involve macros. I think we can generalise the bug to “keyboard shortcuts that appear in the menu can’t be reassigned on MacOS”. Here is another way to replicate the bug:

Steps:

1) Create a new writer document
2) Tools -> Customize…
3) Select the keyboard tab
4) Select Cmd+R or Ctrl+R in the list of shortcut keys
5) Type “Word count” in the find box
6) Click Assign
7) Press OK
8) Press Cmd+R (or Ctrl+R on non-mac)

Bug 1) On MacOS, the text is now aligned to the right instead of opening the word count dialog.

Bug 2) (This happens on GTK/Linux as well) Look at the Format->Align text menu. Notice that the “Right” option still has the Cmd+R shortcut. I think this is what is causing bug1 on MacOS, because on that platform the keys listed in the menu are the overriding decider for what the key does. Presumably the Cocoa toolkit picks whichever shortcut appears first in the menus.

Bonus steps:

9) Tools->Customize…
10) Select Cmd+R or Ctrl+R in the list of shortcut keys
11) Type “Automatic Accessibility Checking” in the find box
12) Click Assign
13) Press OK

Bug 3) (This happens on GTK/Linux as well) If you look in the Tools menu, you’ll see that there’s now two menu items that have the Cmd+R shortcut. Of course the shortcut is still on the align right menu option too.

Now if you restart LibreOffice and look at the tools menu you’ll notice that now only one of the tool menu items has the Cmd+R shortcut. But the align right menu option also still has it.

Maybe the ideal fix would be to make it update the menu properly after customising accelerators so that the menu shortcuts reflect the chosen accelerators. I’m trying to look into this now.
Comment 9 Commit Notification 2025-09-14 19:14:28 UTC
Neil Roberts committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/4be9be221922db6e1872e061b312f3942bca900e

tdf#144560 Remove old key from command when setting new one

It will be available in 26.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 10 Commit Notification 2025-09-14 20:12:40 UTC
Neil Roberts committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/da5b9ee231c1cce5d5c4d8ac3b39d3a047d74afe

tdf#144560 Handle removing shortcuts in osx/salmenu

It will be available in 26.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 11 Patrick (volunteer) 2025-09-14 23:25:17 UTC
Tested in my local master build on macOS Tahoe and the fix works for me.