Bug 73691 - add unicode conversion shortcut like word (alt+x)
Summary: add unicode conversion shortcut like word (alt+x)
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.1.3.2 release
Hardware: All All
: medium enhancement
Assignee: Justin L
QA Contact:
URL:
Whiteboard: target:5.1.0 target:5.2.0 target:5.1...
Keywords:
Depends on:
Blocks: Font-Rendering
  Show dependency treegraph
 
Reported: 2014-01-16 09:40 UTC by Christoph Thielecke
Modified: 2016-10-25 19:08 UTC (History)
10 users (show)

See Also:
Crash report or crash signature:


Attachments
document containing various testing examples for complete implementation (20.50 KB, application/msword)
2015-08-07 07:52 UTC, Justin L
Details
functional prototype for adding AltX support into Calc (22.41 KB, patch)
2015-08-13 15:59 UTC, Justin L
Details
functional prototype for adding AltX support into Calc (4.06 KB, patch)
2015-08-13 16:09 UTC, Justin L
Details
calc test document including sheet4 for multi-range tests (10.29 KB, application/vnd.oasis.opendocument.spreadsheet)
2015-09-17 06:35 UTC, Justin L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christoph Thielecke 2014-01-16 09:40:26 UTC
Word allows to convert a marked decimal 4 digit number to a unicode char by pressing ALT+C. It would be nice to have this functionality also in LO.

Steps:
1. enter a numeric code (e.g. 2122)
2. mark it
3. press ALT+C
4. 2122 is replaced by ™
Comment 1 Regina Henschel 2014-01-16 22:33:22 UTC
Entering arbitrary unicode characters by number need not be a feature of an application but a feature of the operating system. For Windows you need to add the registry item HKEY_Current_User/Control Panel/Input Method/EnableHexNumpad = 1 (Typ REG_SZ) and then you can enter it with ALT key holding down and enter +2122 on the number pad, see
http://en.wikipedia.org/wiki/Unicode_input#Hexadecimal_code_input
Comment 2 Christoph Thielecke 2014-01-17 06:33:42 UTC
(In reply to comment #1)
> Entering arbitrary unicode characters by number need not be a feature of an
> application but a feature of the operating system.
Maybe but I know several cases where its not possible by default or compilicated. Why not add this (simple) feature which also provides compatibility to word? This hits 2 targets.

> For Windows you need to
> add the registry item HKEY_Current_User/Control Panel/Input
> Method/EnableHexNumpad = 1 (Typ REG_SZ) and then you can enter it with ALT
> key holding down and enter +2122 on the number pad, see
> http://en.wikipedia.org/wiki/Unicode_input#Hexadecimal_code_input
I think a normal user will not modify the registry.
Comment 3 Regina Henschel 2014-01-17 15:03:29 UTC
This is a valid request, no question. You might be lucky to find a developer for it here for LibreOffice. But in several discussions on the old OpenOffice.org mailing lists I saw no interest for implementing it. Therefore my hint to switch this feature on in Windows.
Comment 4 Justin L 2015-08-07 07:52:15 UTC
Created attachment 117731 [details]
document containing various testing examples for complete implementation

I think Alt-C is a mis-type, and that the keystroke should be Alt-X.  At least for English locales.  Proposed implementation of Alt-X is listed here: https://gerrit.libreoffice.org/#/c/17535/
Comment 5 Samuel Mehrbrodt (CIB) 2015-08-12 07:57:46 UTC
> I think Alt-C is a mis-type, and that the keystroke should be Alt-X.  At least for English locales.

In German locale it is Alt-C, in English it's Alt-X. I changed the title to Alt-X.
Comment 6 Commit Notification 2015-08-12 14:43:38 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=ff3c4f4c704977b2eec1dba1238b422537e413f3

tdf#73691 Implement MSWord's Alt-X: toggle unicode notation

It will be available in 5.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 7 Commit Notification 2015-08-12 15:52:26 UTC
Samuel Mehrbrodt committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=ddf7618fb56c927f862de7b85f213da352cf2b26

Related tdf#73691: Add different shortcut for German locale

It will be available in 5.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 8 iveand 2015-08-13 09:16:02 UTC
Is there any chance that a backport to 5.0.x can be made available?  It would be a great benefit to many in my work that are dealing with minority language development.

Thanks again for the great work.
Comment 9 Justin L 2015-08-13 15:59:43 UTC
Created attachment 117896 [details]
functional prototype for adding AltX support into Calc

I don't think there would be much demand for altX support in calc, but put together a prototype to validate the basic implementation.
Comment 10 Justin L 2015-08-13 16:09:29 UTC
Created attachment 117897 [details]
functional prototype for adding AltX support into Calc
Comment 11 Samuel Mehrbrodt (CIB) 2015-08-19 15:46:48 UTC
> I don't think there would be much demand for altX support in calc, but put together a prototype to validate the basic implementation.

Would you mind pushing this to Gerrit? I guess for consistency it's good to have it in Calc also, even if it might be rarely used.
Comment 12 Óvári 2015-08-22 09:42:02 UTC
Would it also possible to have this feature in LO Impress (and maybe even Draw)?

Thank you
Comment 13 Wouter Minten 2015-08-26 11:42:00 UTC
I've been using Ubuntu for a while, the OS shortcut for inserting unicode chars is Ctrl+Shift+u > type codepoint > Enter.

I would like to see an option for LO to insert unicode on windows Alt+x style. I suggest making it a checkbox option in the settings menu for LO. "☑ Use Alt+x to convert string to unicode" or "☑ Convert string to unicode character with %hotkey"

(I don't use Windows, but my colleage does and had to insert Chinese characters into a document, he found that using the Special Character menu was slow, when I let him use my Ubuntu station he could punch in the Chinese Characters much faster using the Ctrl+Shift+u method. (Chinese characters are unicode range U+3400-U+4DBF))
Comment 14 Justin L 2015-08-26 13:58:45 UTC
Wouter Minten:  Alt-X support has already been added to LibreOffice.  It will be available when 5.1 is released in about 6 months.  No checkboxes required - just type the numbers and press Alt-X at the end.

Óvári:  Alt-X support was added for Writer, Impress, and Draw.  Calc support is planned to be included shortly.
Comment 15 Commit Notification 2015-09-15 06:49:23 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=7c9a484249da249dea7129ca93f5d1cbf5fbe462

tdf#73691 - add alt-x support to calc

It will be available in 5.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 16 Justin L 2015-09-17 06:35:56 UTC
Created attachment 118782 [details]
calc test document including sheet4 for multi-range tests

The reviewer suggested supporting Calc alt-X for a range of cells, so I created this patch.  It could be handy for anyone doing Unicode documentation to easily create tables of Unicode-related information.

proposed patch submitted to https://gerrit.libreoffice.org/18661
Comment 17 Iandol 2015-10-05 00:26:39 UTC
This doesn't work on OS X, and using ALT is already used for selecting keyboard characters. OS X has a unicode hex input keyboard which means you 1) hold down ALT, 2) type unicode code, 3) release ALT. But as this was added for Windows even though it has an OS option, is there a reason this hasn't been adapted for OS X?
Comment 18 Samuel Mehrbrodt (CIB) 2015-10-05 06:26:53 UTC
> This doesn't work on OS X, and using ALT is already used for selecting keyboard characters.

Do you have a suggestion which shortcut to use on OS X? Do you know how Microsoft Office handles this?
Comment 19 Iandol 2015-10-05 09:08:31 UTC
Hi, to clarify I tested on 

Version: 5.1.0.0.alpha1+
Build ID: e3f8eb8d3a594e3b8afa51c214f6c5c44d8dde4e
TinderBox: MacOSX-x86_64@49-TDF, Branch:master, Time: 2015-10-04_07:07:55
Locale: en-US (en.UTF-8)

The ALT [Option ⌥] key is used in OS X for additional symbols, ALT-X is ≈ and ALT-C is ç. OS X uses CTRL much less than ALT, but does use CTRL for Emacs style editing OS-wide. I've looked at the standard key bindings for OS X:

https://support.apple.com/en-gb/HT201236

Both CTRL-X and CTRL-C are NOT bound to anything (remember that cut/copy/paste on OS X use the [CMD ⌘] key), so are available by the OS.

I have Office 2016 and as far as I can tell they don't support any special unicode input on OS X, they have the special character input panel which you can customise keybindings for unicode key points.
Comment 20 Justin L 2015-10-05 12:05:17 UTC
(In reply to Iandol from comment #19)

A google search confirms that MS Word for the Mac does NOT assign a keyboard shortcut like Alt-X.  So there is no "standard to copy" in this regard.  Using Ctrl-X seems like a logical choice, except that Mac newbies might use that trying to "cut".

(Documention)
Details about this Alt-X feature coming in LibreOffice 5.1.x:
1.) toggles (switches back and forth) between the character to the left of the cursor and its Unicode notation. (My primary design goal was to be able to FIND the unicode notation for an existing character, although most people use this to CREATE a character they can't type directly.)
2.) intelligently handles combining characters, expanding the entire character immediately.
3.) selection is not necessary, but if used will limit the input to those characters.  (Draw/Impress/Calc have the final result selected, but not Writer.)
4.) handles all 16 Unicode planes
5.) Available in Writer, Draw, Impress, and Calc.
6.) Re-assignable keyboard shortcut: Tools - Customize - Keyboard - Options category - Toggle Unicode Notation function.  Defaults to Alt-X assigned at the global level.
Comment 21 Samuel Mehrbrodt (CIB) 2015-10-05 17:34:54 UTC
(In reply to Justin L from comment #20)
> (Documention)
> Details about this Alt-X feature coming in LibreOffice 5.1.x:

Added your documentation to https://wiki.documentfoundation.org/ReleaseNotes/5.1#Unicode_character_input_with_Alt.2BX
Comment 22 Samuel Mehrbrodt (CIB) 2015-10-05 17:35:32 UTC
(In reply to Justin L from comment #20)
> Using Ctrl-X seems like a logical choice, except that Mac newbies might use
> that trying to "cut".

Do we have a possibility to set OS-specific shortcuts?
Comment 23 Iandol 2015-10-05 17:41:04 UTC
Hi Justin, I wouldn't worry about Mac newbies, they'll need to learn CTRL == CMD anyway and it is in almost all guides and visible in all menus...

Thanks to all who worked on this!
Comment 24 Iandol 2015-10-05 21:18:43 UTC
Just to say I can't actually edit CTRL key bindings using Tools > Customise on OS X with 5.1alpha, but trying something like ⇧⌥F1 and the unicode toggle works in OS X.
Comment 25 Justin L 2015-10-06 16:56:22 UTC
Iandol - are you compiling LO on your Mac?

Patch proposed on gerrit to add Command-Option-X as keyboard shortcut for macosx. https://gerrit.libreoffice.org/18661

Can you confirm that nothing happens in LO (before the patch) with Command-Option-X?  German confirmation of the same would be nice too. Command-Option-C will not be an option for German because it is already used.  I picked X_MOD1_MOD2 because another function did the same for the Mac, it isn't used in the apple shortcuts document, and it shows up in the Keyboard list.  I can easily change it to use Ctrl instead with X_MOD3 (and C_MOD3 for German) if that is preferable.
Comment 26 Justin L 2015-10-07 10:37:56 UTC
Oops: last link was the same link as in comment 16.

https://gerrit.libreoffice.org/19224 - tdf#73691 add compatible macosx keyboard shortcut for ToggleUnicode
Comment 27 Commit Notification 2015-10-07 12:17:00 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=ad0a17dac402852758d93b4efff522dd509c51f0

tdf#73691 add compatible macosx keyboard shortcut for ToggleUnicode

It will be available in 5.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 28 Laurent BP 2015-10-11 16:22:33 UTC
That looks great :)
I opened a new bug report bug 94957 to ask to also add it to Math.
Comment 29 Commit Notification 2015-10-15 13:37:57 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=6212c467156e2bd4580a9f8145124223d3135ea4

tdf#73691 - add alt-x support to math

It will be available in 5.1.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 30 Commit Notification 2015-11-05 18:19:03 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=c93db073425e61907a290f3f5826c0f79f310275

related tdf#73691 - prevent AltX creating control characters

It will be available in 5.1.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 31 Cor Nouws 2015-11-12 10:58:48 UTC
Hi all,

Since the menu Tools in Dutch is Extra with accelerator on x :) we'd better find another one for that?

Cheers - Cor
Comment 32 Samuel Mehrbrodt (CIB) 2015-11-12 11:04:57 UTC
(In reply to Cor Nouws from comment #31)
> Since the menu Tools in Dutch is Extra with accelerator on x :) we'd better
> find another one for that?

In German we use Alt-C for the same reason (Word does the same). Should we do the same for Dutch? (Maybe you can check what Word does?)
Comment 33 Justin L 2015-12-01 12:45:01 UTC
(In reply to Samuel Mehrbrodt from comment #32)
> In German we use Alt-C for the same reason (Word does the same). Should we
> do the same for Dutch? (Maybe you can check what Word does?)

My contacts indicate that MSWord with the Dutch interface uses Alt-X for toggling unicode - it apparently does not conflict with any menu shortcuts.  


Potential LO conflicts with Alt-X  (found via git grep -i -A1 '~File\|~Edit\|~View\|~Insert\|F~ormat\|T~able\|~Tools\|~Window\|~Help\|~Data\|~Slide Show\|~Modify' | grep -i -B1 'msgstr.*~x'  in Translations)

German (fixed already.  Word uses Alt-C)
de/officecfg/registry/data/org/openoffice/Office/UI.po:msgid "~Tools"
de/officecfg/registry/data/org/openoffice/Office/UI.po-msgstr "E~xtras"

Basque (Word uses ??.  Is Alt-C free: probably)
eu/officecfg/registry/data/org/openoffice/Office/UI.po:msgid "~Insert"
eu/officecfg/registry/data/org/openoffice/Office/UI.po-msgstr "T~xertatu"

Galician (Word uses ??.  Is Alt-C free: probably)
gl/officecfg/registry/data/org/openoffice/Office/UI.po:msgid "~Window"
gl/officecfg/registry/data/org/openoffice/Office/UI.po-msgstr "~Xanela"

Dutch (Word uses Alt-X.  Is Alt-C free: probably)
nl/officecfg/registry/data/org/openoffice/Office/UI.po:msgid "~Tools"
nl/officecfg/registry/data/org/openoffice/Office/UI.po-msgstr "E~xtra"

Brazil (Word uses ??.  Is Alt-C free: probably)
pt-BR/officecfg/registry/data/org/openoffice/Office/UI.po:msgid "~View"
pt-BR/officecfg/registry/data/org/openoffice/Office/UI.po-msgstr "E~xibir"

Tsonga (Word uses ??.  Is Alt-C free: probably)
ts/officecfg/registry/data/org/openoffice/Office/UI.po:msgid "~File..."
ts/officecfg/registry/data/org/openoffice/Office/UI.po-msgstr "~Xisefo..."

Vietnamese (Word uses ??.  Is Alt-C free: probably)
vi/officecfg/registry/data/org/openoffice/Office/UI.po:msgid "~View"
vi/officecfg/registry/data/org/openoffice/Office/UI.po-msgstr "~Xem"
Comment 34 Justin L 2015-12-03 09:55:24 UTC
Languages can be tested by compiling with --with-lang=de nl etc added to autogen.input.  I noticed that accelerator keys take priority over menu keys, so my Alt-X function is being activated by someone trying to negotiate the menus with keystrokes (i.e. my function is not disabled during a conflict which is what I had assumed).

Alt-X is STILL being defined in German ALONG WITH Alt-C, so BOTH are active.  A blank entry is needed to "undefine" alt-x in each language that overrides.
Patch submitted:  https://gerrit.libreoffice.org/20365

tsonga: File menu not actually translated - still is ~File.  Not over-riding
vietnamese: Alt-C is used as well, for ~Tools.  Not assigning any accelerator key for now.  Perhaps a Vietnamese can suggest an appropriate combination.

Patch submitted to reassign to Alt-C for eu, gl, nl, pt-PR: https://gerrit.libreoffice.org/20370
Comment 35 Nguyen Vu Hung 2015-12-04 04:11:44 UTC
For Vietnamese, I/we suggest changing the shortcuts


-----
Vietnamese (Word uses ??.  Is Alt-C free: probably)
vi/officecfg/registry/data/org/openoffice/Office/UI.po:msgid "~View"
vi/officecfg/registry/data/org/openoffice/Office/UI.po-msgstr "~Xem"


ref.
https://www.facebook.com/groups/vietlug/permalink/1023190424368502/
https://www.facebook.com/groups/libovn/permalink/918445438244427/
http://lists.hanoilug.org/pipermail/hanoilug/2015-December/036627.html
Comment 36 Commit Notification 2015-12-04 07:25:07 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=f0282aeddc4df555a273c20e8480cef586960ac8

related to tdf#73691 - don't conflict with menu hotkeys

It will be available in 5.2.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 37 Commit Notification 2015-12-04 07:26:57 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "libreoffice-5-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=e806e700e7084eedf1e993062e5e8a6154eb5338&h=libreoffice-5-1

related to tdf#73691 - don't conflict with menu hotkeys

It will be available in 5.1.0.1.

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

Affected users are encouraged to test the fix and report feedback.
Comment 38 Commit Notification 2015-12-04 07:34:14 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=2ffe2b0c746a64467b4115523f91ce391ab9b229

related to tdf#73691 - AltX: use alt-c for eu, gl, nl, pt-BR

It will be available in 5.2.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 39 Commit Notification 2015-12-04 07:34:18 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "libreoffice-5-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=18f668d9e15cd86448bc3e470f5b3e8a534beb06&h=libreoffice-5-1

related to tdf#73691 - AltX: use alt-c for eu, gl, nl, pt-BR

It will be available in 5.1.0.1.

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

Affected users are encouraged to test the fix and report feedback.
Comment 40 V Stuart Foote 2015-12-13 17:34:15 UTC
adding to the bug 71732 Meta tracker