Download it now!
Bug 129547 - Default shortcut key for insert current time doesn't work (French)
Summary: Default shortcut key for insert current time doesn't work (French)
Status: REOPENED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.3.4.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Shortcuts-Locale 98295
  Show dependency treegraph
 
Reported: 2019-12-22 10:00 UTC by Julien Nabet
Modified: 2020-07-03 09:30 UTC (History)
10 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 Julien Nabet 2019-12-22 10:00:13 UTC
Description:
On pc Debian x86-64, shortcuts are:
Ctrl+; for insert current date (it works)
Ctrl+Shift+; for insert current time (it doesn't work)






Steps to Reproduce:
1. Launch Calc
2. Try Ctrl+Shift;

Actual Results:
Nothing happens

Expected Results:
Either Ctrl+Shift; should insert current time


Reproducible: Always


User Profile Reset: No



Additional Info:
See French Keyboard layout here:
https://en.wikipedia.org/wiki/AZERTY#/media/File:KB_France.svg

In French:
"
Pour insérer l’heure actuelle, appuyez sur Ctrl+Maj+; (point-virgule).
Pour insérer la date actuelle, appuyez sur Ctrl+; (point-virgule).
"
from:
https://support.office.com/fr-fr/article/ins%C3%A9rer-la-date-et-l-heure-actuelles-dans-une-cellule-b5663451-10b0-40ab-9e71-6b0ce5768138
Comment 1 Julien Nabet 2019-12-22 10:27:30 UTC
Argh, it seems https://support.office.com/fr-fr/article/ins%C3%A9rer-la-date-et-l-heure-actuelles-dans-une-cellule-b5663451-10b0-40ab-9e71-6b0ce5768138 is a wrong translation.

Perhaps insert current time is Ctrl + : in Excel.
see https://www.blogdumoderateur.com/raccourcis-clavier-excel/
or Ctrl + ,
see https://www.formuleexcel.com/74-raccourcis-clavier-pour-excel/

Sophie/Jean-Baptiste: if one of you has Excel, could you give it a try?
What's the shortcut to insert current time with French keyboard layout?
(I can only test at my job where I got Excel and I'm in vacation)
Comment 2 Julien Nabet 2019-12-22 11:23:23 UTC
If I add this line:
<value xml:lang="fr">.uno:InsertCurrentDate</value>
in COMMA_SHIFT_MOD1 block from officecfg/registry/data/org/openoffice/Office/Accelerators.xcu
see (https://opengrok.libreoffice.org/xref/core/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu?r=ef5133e4#1209), I can type:
Ctrl+shift+, and it inserts the current time

If I add this same line in SEMICOLON_SHIFT_MOD1 (and whereas this shortcut already exists according to Options/Customize/keys but don't know how), it doesn't work.
Comment 3 m.a.riosv 2019-12-22 18:35:32 UTC
There is a long thread about in tdf#12888, tdf#126085, tdf88027.

The issue happens with all languages where the ';' is the uppercase of the key.

Seems to me this is a dup of tdf88027
Comment 4 GerardF 2019-12-23 09:17:54 UTC
(In reply to Julien Nabet from comment #1)
> Argh, it seems
> https://support.office.com/fr-fr/article/ins%C3%A9rer-la-date-et-l-heure-
> actuelles-dans-une-cellule-b5663451-10b0-40ab-9e71-6b0ce5768138 is a wrong
> translation.
> 
> Perhaps insert current time is Ctrl + : in Excel.
> see https://www.blogdumoderateur.com/raccourcis-clavier-excel/
> or Ctrl + ,
> see https://www.formuleexcel.com/74-raccourcis-clavier-pour-excel/
> 
> Sophie/Jean-Baptiste: if one of you has Excel, could you give it a try?
> What's the shortcut to insert current time with French keyboard layout?
> (I can only test at my job where I got Excel and I'm in vacation)


Office 365, French UI :
Time is inserted with Ctrl+:
Comment 5 GerardF 2019-12-23 09:25:22 UTC
Also, I don't know if it's important but (in Excel) after inserting date or time with Ctrl+; or Ctrl+: the cell is in "edit mode".
Comment 6 Julien Nabet 2019-12-23 09:26:54 UTC
I noticed it doesn't work with gtk3 and gen renderings but with kf5 rendering it worked!
Ctrl+; => insert current date
Ctrl+Shift+; => insert current time
Comment 7 Julien Nabet 2019-12-23 09:27:55 UTC
(In reply to GerardF from comment #5)
> Also, I don't know if it's important but (in Excel) after inserting date or
> time with Ctrl+; or Ctrl+: the cell is in "edit mode".

So the shorcut to insert current time is "Ctrl+:" in Excel ? (with French UI and French keyboard layout) and not Ctrl+Shift+; ?
Comment 8 Julien Nabet 2019-12-23 09:28:32 UTC
(In reply to Julien Nabet from comment #7)
> (In reply to GerardF from comment #5)
> > Also, I don't know if it's important but (in Excel) after inserting date or
> > time with Ctrl+; or Ctrl+: the cell is in "edit mode".
> 
> So the shorcut to insert current time is "Ctrl+:" in Excel ? (with French UI
> and French keyboard layout) and not Ctrl+Shift+; ?

Ok I just saw you previous comment.
Comment 9 Julien Nabet 2019-12-23 09:33:50 UTC
Heiko/Xisco/Eike: in French, if we want to copycat to Excel, it seems we should add "Ctrl+:" for insertCurrentTime, ok for this?

Eike: KEY_COLON isn't defined in offapi/com/sun/star/awt/Key.idl (see https://opengrok.libreoffice.org/xref/core/offapi/com/sun/star/awt/Key.idl?r=9c0d40fb), should we just add it?
Comment 10 Heiko Tietze 2019-12-23 10:24:12 UTC
On a German keyboard I cannot use ctrl+; as it requires the shift key - thus only time works for me. You can assign localized shortcuts to the uno commands, so the default remains. And no objection to allow customization per colon.

Better keyboard customization is needed, see bug 115052. One of the GSoC ideas is about that (sounds like a huge effort to me). Additionally, my preferred solution are extensions, see bug 123768.

I would close the referenced Estonian, Russian, German etc. tickets as duplicates, or this one.
Comment 11 Julien Nabet 2019-12-31 10:23:28 UTC
(In reply to Julien Nabet from comment #6)
> I noticed it doesn't work with gtk3 and gen renderings but with kf5
> rendering it worked!
> Ctrl+; => insert current date
> Ctrl+Shift+; => insert current time

On Win10 with master sources updated today + French locale, these shortcuts work.
Idem for LO 6.3.4.2 on Win10.
Comment 12 m.a.riosv 2020-01-05 22:45:01 UTC
It doesn't work for me on Win 10, with Spanish keyboard layout.
Version: 6.5.0.0.alpha0+ (x64)
Build ID: c97f9af5e47ea234ad709a1f66c1e8ed20640066
CPU threads: 4; OS: Windows 10.0 Build 19041; UI render: GL; VCL: win; 
Locale: es-ES (es_ES); UI-Language: en-US
Calc: threaded

I don't know how it can work without change the shortcut, at least on Spanish layout, semicolon it's the capital of comma, so can't be reached with [ctrlç;]
Comment 13 Julien Nabet 2020-01-06 19:46:45 UTC
(In reply to m.a.riosv from comment #12)
> ...
> I don't know how it can work without change the shortcut, at least on
> Spanish layout, semicolon it's the capital of comma, so can't be reached
> with [ctrlç;]

Here's French keyboard:
http://xahlee.info/kbd/french_keyboard_layout.html
No need to use "Shift" to access ";" and ":"

On the contrary, if I believe https://commons.wikimedia.org/wiki/File:KB_Spanish.svg, with Spanish keyboard, you need "Shift" for both.
Comment 14 m.a.riosv 2020-01-06 23:03:40 UTC
Right(In reply to Julien Nabet from comment #13)
> On the contrary, if I believe
> https://commons.wikimedia.org/wiki/File:KB_Spanish.svg, with Spanish
> keyboard, you need "Shift" for both.
For the second [Ctrl+Shift+;] works as expected, the issue is with [Ctrl+;] there is no way to reach it.
Comment 15 Julien Nabet 2020-01-11 23:48:24 UTC
Caolán: any idea why it would work with kf5 not with gtk3 or gen rendering?

I tried to retrieve a bt when it was ok on kf5 but it doesn't help. It doesn't show where the event comes from.
Comment 16 Caolán McNamara 2020-01-12 16:35:29 UTC
I don't see it working with kf5 locally when I set my keyboard map to fr AZERTY, but GetKeyCode in vcl/qt5/Qt5Widget.cxx is probably the place to examine to see what key on the keyboard is considered pressed by the kf5 stuff

Another thing you can do here is at XMLBasedAcceleratorConfiguration::getCommandByKeyEvent
add...
fprintf(stderr, "pressed %s\n", lcl_getKeyString(aKeyEvent).toUtf8().getStr());
and press the key combo and see what shows up here.

My understanding is that (under gtk3/gen at least) on your french keyboard it will say POINT_MOD1 for ctrl+: IIRC because we try do a mapping back of the "unknown" key that produced the : back to what key is at the same position in qwerty layout (vcl/unx/gtk3/gtk3gtkframe.cxx at the fdo#41169 comment)
Comment 17 Julien Nabet 2020-01-12 16:47:51 UTC
(In reply to Caolán McNamara from comment #16)
> ...
> 
> Another thing you can do here is at
> XMLBasedAcceleratorConfiguration::getCommandByKeyEvent
> add...
> fprintf(stderr, "pressed %s\n",
> lcl_getKeyString(aKeyEvent).toUtf8().getStr());
> and press the key combo and see what shows up here.
> 
> My understanding is that (under gtk3/gen at least) on your french keyboard
> it will say POINT_MOD1 for ctrl+: IIRC because we try do a mapping back of
> the "unknown" key that produced the : back to what key is at the same
> position in qwerty layout (vcl/unx/gtk3/gtk3gtkframe.cxx at the fdo#41169
> comment)

Ctrl + ";" gives SEMICOLON_MOD1
and Ctrl + Shift + ";" gives POINT_SHIFT_MOD1

With Ctrl + ":", I got an assertion:
#5  0x00007fffdd8a42e0 in rtl::OUString::copy(int, int) const (this=0x7fffffff0fc0, beginIndex=4, count=-3) at /home/julien/lo/libreoffice/include/rtl/ustring.hxx:2256
#6  0x00007fffdd8a4280 in rtl::OUString::copy(int) const (this=0x7fffffff0fc0, beginIndex=4) at /home/julien/lo/libreoffice/include/rtl/ustring.hxx:2238
#7  0x00007fffdd89a37a in framework::lcl_getKeyString(com::sun::star::awt::KeyEvent const&) (aKeyEvent=...) at /home/julien/lo/libreoffice/framework/source/accelerators/acceleratorconfiguration.cxx:66
#8  0x00007fffdd89a84f in framework::XMLBasedAcceleratorConfiguration::getCommandByKeyEvent(com::sun::star::awt::KeyEvent const&) (this=0x5555584c8e40, aKeyEvent=...)
    at /home/julien/lo/libreoffice/framework/source/accelerators/acceleratorconfiguration.cxx:102
#9  0x00007ffff2ace010 in svt::AcceleratorExecute::impl_ts_findCommand(com::sun::star::awt::KeyEvent const&) (this=0x555558986680, aKey=...)
    at /home/julien/lo/libreoffice/svtools/source/misc/acceleratorexecute.cxx:263
#10 0x00007ffff2acda5d in svt::AcceleratorExecute::execute(com::sun::star::awt::KeyEvent const&) (this=0x555558986680, aAWTKey=...) at /home/julien/lo/libreoffice/svtools/source/misc/acceleratorexecute.cxx:174
#11 0x00007ffff2acd9ca in svt::AcceleratorExecute::execute(vcl::KeyCode const&) (this=0x555558986680, aVCLKey=...) at /home/julien/lo/libreoffice/svtools/source/misc/acceleratorexecute.cxx:168
#12 0x00007ffff5afc0e0 in SfxViewShell::ExecKey_Impl(KeyEvent const&) (this=0x5555585ae0a0, aKey=...) at /home/julien/lo/libreoffice/sfx2/source/view/viewsh.cxx:1443
Comment 18 Julien Nabet 2020-01-12 16:50:49 UTC
Caolán: there are 2 parts
1) Ctrl + shift + ";" doesn't work
2) ":" so COLON isn't declared and it seems it should:
see https://bugs.documentfoundation.org/show_bug.cgi?id=129547#c9
(I'm waiting for Eike's feedback here since I got UX ok from Heiko).
Comment 19 Julien Nabet 2020-01-12 17:12:04 UTC
In French keyboard (see https://en.wikipedia.org/wiki/AZERTY#/media/File:KB_France.svg) we got "," and "?" (maj part) on the same key.
and we have ";" and "." (maj part) on the same key
When I do:
Ctrl + "," => COMMA_MOD1 (expected)
Ctrl + Shift "," => COMMA_SHIFT_MOD1 (why not)

Ctrl + ";" => SEMICOLON_MOD1 (expected)
Ctrl + Shift + ";" => POINT_SHIFT_MOD1

There are 2 incompatible logical mechanisms here.
Either we should have in first part QUESTION_SHIFT_MOD1 (I don't know if "?" is mapped and if "QUESTION" is the right mapping)
or we should have : SEMICOLON_SHIFT_MOD1
Comment 20 Julien Nabet 2020-01-12 17:32:23 UTC
I just noticed that with US keyboard layout, maj/shift of ";" corresponds to ":" (the one which should perhaps be declared) so perhaps everything is related here in a way.
Comment 21 Caolán McNamara 2020-01-13 16:22:08 UTC
"With Ctrl + ":", I got an assertion:", was that with all backends, or just gtk3 ?

wrt adding COLON as a key, presumably that on its own won't do anything ? Unless we detect that the COLON key is pressed in our various vcl-plugs and backends and transport that information around. And I don't think that's as trivial as it might appear on the surface.
Comment 22 Julien Nabet 2020-01-13 16:42:07 UTC
(In reply to Caolán McNamara from comment #21)
> "With Ctrl + ":", I got an assertion:", was that with all backends, or just
> gtk3 ?
> 
> wrt adding COLON as a key, presumably that on its own won't do anything ?
> Unless we detect that the COLON key is pressed in our various vcl-plugs and
> backends and transport that information around. And I don't think that's as
> trivial as it might appear on the surface.

Yes I sent an email to Eike with lo-dev forum in cc here:
http://document-foundation-mail-archive.969070.n3.nabble.com/About-tdf-129547-and-adding-COLON-td4272064.html

I thought about submitting a patch containing not only the add of a new code in offapi/com/sun/star/awt/Key.idl  but of course, I would have mimicked SEMICOLON/COMMA uses so the new key would have been used (so impact in vcl-plugs indeed).
Comment 23 Eike Rathke 2020-01-13 18:34:39 UTC
As replied on the mailing list, I don't see why COLON should not be added, similar to SEMICOLON. Be sure to catch all relevant places where something has to be added to pass things around.

So for time Ctrl+: it would be COLON_MOD1 if I'm not mistaken.
Comment 24 Julien Nabet 2020-01-13 19:35:05 UTC
(In reply to Eike Rathke from comment #23)
> As replied on the mailing list, I don't see why COLON should not be added,
> similar to SEMICOLON. Be sure to catch all relevant places where something
> has to be added to pass things around.
> 
> So for time Ctrl+: it would be COLON_MOD1 if I'm not mistaken.

Thank you for your feedback.
I submitted this patch https://gerrit.libreoffice.org/c/core/+/86713 on gerrit.
I'll take a look at the result from the different Jenkins since the patch contains lines for Macos, Win and Linux.

If it's ok, I'd submit another patch to declare the ":" shortcut for French localization.
Comment 25 Valter Mura 2020-01-18 18:24:32 UTC
Same problem for Italian keyboard layout
Comment 26 Valter Mura 2020-01-18 18:25:34 UTC
*** Bug 130073 has been marked as a duplicate of this bug. ***
Comment 27 Heiko Tietze 2020-07-03 09:02:10 UTC

*** This bug has been marked as a duplicate of bug 126085 ***
Comment 28 Julien Nabet 2020-07-03 09:20:34 UTC
On pc Debian x86-64 with master sources updated today, it still fails

Ctrl + :
or Ctrl + Shift + ; doesn't insert time.
Comment 29 Julien Nabet 2020-07-03 09:23:37 UTC
(In reply to Julien Nabet from comment #28)
> On pc Debian x86-64 with master sources updated today, it still fails
> 
> Ctrl + :
> or Ctrl + Shift + ; doesn't insert time.

Precision: i tried with a brand new LO profile + French UI
Comment 30 Mihkel Tõnnov 2020-07-03 09:30:31 UTC
(In reply to Valter Mura from comment #26)
> *** Bug 130073 has been marked as a duplicate of this bug. ***

(In reply to Heiko Tietze from comment #27)
> 
> *** This bug has been marked as a duplicate of bug 126085 ***

Unlike Italian and German layouts, French does have a semicolon key (according to Wikipedia, anyway). So those two bugs are not related to this one.