Bug 150511 - Typing ZWNJ in Writer is not possible on Windows
Summary: Typing ZWNJ in Writer is not possible on Windows
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.4.0.3 release
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: RTL-CTL ZWNJ-ZWJ
  Show dependency treegraph
 
Reported: 2022-08-20 09:26 UTC by Hossein
Modified: 2023-06-02 14:28 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hossein 2022-08-20 09:26:48 UTC
Description:
On Windows, the default shortcut for ZWNJ is ctrl+shift+2. To use that, one should activate Persian keyboard layout, and then press this key combination.

Zero-width non-joiner
https://en.wikipedia.org/wiki/ZWNJ

At the same time, typing ZWNJ using this key combination is possible in Notepad.

Steps to Reproduce:
1. Open LibreOffice Writer
2. Activate Persian keyboard layout
3. Press ctrl+shift+2

Actual Results:
Nothing happens. Please note that ZWNJ is not visible on the screen, but one can understand its presence by its effect on separating parts of the word.

Expected Results:
ZWNJ should be inserted in the document. For example, if you type می then ZWNJ and then شود you should get می‌شود, but you will get میشود that means ZWNJ is not there.


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.5.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: f505d8fee149f089090b208db99a7b4107af76e9
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: fa-IR (fa_IR); UI: en-US
Calc: threaded
Comment 1 Dieter 2023-05-14 10:17:33 UTC
Hossein, it seems, that nobody could confirm your report for half a year. I don't use Persian keyboard layout, but I also couldn't find any information, that LO has a shortcurt for ZWNJ. 

I couldn't find any information in oline help and also in guide for keyboard shortcuts [1]. So I would like to ask design-team, if this feature is available and how.

cc: Design-Team

[1] https://wiki.documentfoundation.org/images/e/e4/GS7414-KeyboardShortcuts.odt
Comment 2 Hossein 2023-05-14 10:58:57 UTC
(In reply to Dieter from comment #1)
> Hossein, it seems, that nobody could confirm your report for half a year. I
> don't use Persian keyboard layout, but I also couldn't find any information,
> that LO has a shortcurt for ZWNJ. 
> 
> I couldn't find any information in oline help and also in guide for keyboard
> shortcuts [1]. So I would like to ask design-team, if this feature is
> available and how.
> 
> cc: Design-Team
> 
> [1]
> https://wiki.documentfoundation.org/images/e/e4/GS7414-KeyboardShortcuts.odt
Thank you Dieter, for your response.

Actually, there are other methods available to insert ZWNJ other than pressing ctrl+shift+2, like assigning a shortcut to insert this specific character. The same method can also be used in MS Word. But, I expect that pressing ctrl+shift+2 also works.

But, anyway, installing Persian keyboard in Windows is not that hard. It only takes a few clicks, and you may remove it later. For example, see:

How To Type in Farsi (Persian) On Windows 10
https://www.lingalot.com/install-farsi-keyboard-windows-10/
Comment 3 Heiko Tietze 2023-05-15 07:29:04 UTC Comment hidden (off-topic)
Comment 4 Hossein 2023-05-15 12:07:57 UTC
The ctrl+shift+2 actually generates ZWNJ in Persian keyboard, so there should not be any command or shortcut needed. I compare it to having ß or § on a German keyboard.

I assume that LibreOffice ignores this character on Windows for some reason. I have seen this behavior elsewhere, for example in Qt, and KDE.

So, the request is not to ignore the ZWNJ character input from the keyboard.
Comment 5 Heiko Tietze 2023-05-15 12:21:02 UTC
Ctrl+Shift+<1..6> control the number format but customization is disabled for some reason.

It's defined in officecfg/registry/data/org/openoffice/Office/Accelerators.xcu

        <node oor:name="2_SHIFT_MOD1" oor:op="replace">
          <prop oor:name="Command">
            <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
            <value xml:lang="en-US" install:module="unxwnt">.uno:NumberFormatScientific</value>
          </prop>
        </node>

Doubt we can just set it an empty value to clear the shortcut for some language like

            <value xml:lang="per-FA"></value>


MSO uses Ctrl+Shift+Caret [1], which is not possible cross-platform with our way to handle shortcuts.

Could imagine a toggle function similar to upper/lower case instead of individual commands. 

[1] https://support.microsoft.com/en-us/office/keyboard-shortcuts-in-excel-1798d9d5-842a-42b8-9c99-9b7213f0040f
Comment 6 Maxim Monastirsky 2023-05-20 22:56:26 UTC Comment hidden (obsolete)
Comment 7 Maxim Monastirsky 2023-05-20 23:03:48 UTC
(In reply to Heiko Tietze from comment #5)
> Ctrl+Shift+<1..6> control the number format
Only for Calc, while this bug is reported against Writer. Which suggests that the problem is somewhere else.

> but customization is disabled for some reason.
These keys are listed as reserved in https://opengrok.libreoffice.org/xref/core/vcl/source/app/svapp.cxx?r=5c73c3aa#107. But I have no idea why and how they are actually used.

> Doubt we can just set it an empty value to clear the shortcut for some
> language like
> 
>             <value xml:lang="per-FA"></value>
This actually might work. Looking at the code in XCUBasedAcceleratorConfiguration::impl_ts_load we seem to leave the shortcut as undefined in case of an empty command, and not falling back to en-US.
Comment 8 Heiko Tietze 2023-05-22 07:14:20 UTC
(In reply to Maxim Monastirsky from comment #7)
> These keys are listed as reserved in...
IIRC, Miklos told me that reserved keys are used for some development testing.
 
> > ...we can just set it an empty value to clear the shortcut...
> This actually might work. Looking at the code in
> XCUBasedAcceleratorConfiguration::impl_ts_load we seem to leave the shortcut
> as undefined in case of an empty command, and not falling back to en-US.

Hossein, mind to test this? Would be the safest solution.
Comment 9 Miklos Vajna 2023-05-22 07:18:07 UTC
(In reply to Heiko Tietze from comment #8)
> IIRC, Miklos told me that reserved keys are used for some development
> testing.

Hm, I can't recall that. I'm afraid I don't know much about those reserved keys, either. Platform-specific reserved keys are ugly.
Comment 10 Hossein 2023-05-22 14:33:57 UTC
(In reply to Heiko Tietze from comment #8)
> (In reply to Maxim Monastirsky from comment #7)
> > These keys are listed as reserved in...
> IIRC, Miklos told me that reserved keys are used for some development
> testing.
>  
> > > ...we can just set it an empty value to clear the shortcut...
> > This actually might work. Looking at the code in
> > XCUBasedAcceleratorConfiguration::impl_ts_load we seem to leave the shortcut
> > as undefined in case of an empty command, and not falling back to en-US.
> 
> Hossein, mind to test this? Would be the safest solution.
Unfortunately this change didn't help. Even removing the whole node didn't change anything, and the shortcut wasn't usable.
Comment 11 Heiko Tietze 2023-06-02 14:28:24 UTC
My patch https://gerrit.libreoffice.org/c/core/+/152279 got no reply and since I cannot test myself I'm going to abandon it.

For dev advice see ESC minutes in https://listarchives.libreoffice.org/global/projects/msg02950.html