Bug Hunting Session
Bug 107356 - Key pressed / Key released events from list boxes don't respond to ctrl-keys
Summary: Key pressed / Key released events from list boxes don't respond to ctrl-keys
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
5.2.5.1 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-22 18:30 UTC by Howard Johnson
Modified: 2018-05-12 02:28 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Example database which uses this event (38.51 KB, application/vnd.oasis.opendocument.database)
2017-04-22 18:48 UTC, Howard Johnson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Howard Johnson 2017-04-22 18:30:25 UTC
In LibreOffice Calc (and in MS Access) you can press Ctrl-' (control tick) to quickly copy the field above into the current cell.

This can be simulated as described here:  https://forum.openoffice.org/en/forum/viewtopic.php?f=21&t=83531&p=415865#p415865 , ...well, almost. ;-)

All controls work properly with Ctrl-tick except list boxes.  List boxes seem to swallow up keystrokes that have a control key modifier and never report a keystroke event, either up or down.

Alt key modifiers work as expected in all controls.

The reason this is important is to try and maintain uniformity with Calc and Access which both use Ctrl-tick for this feature.  The author's Alt-Tick workaround, works, but makes Base non-standard.

I think this should be relatively easily fixed.  The hope is that this utility can someday be merged into Base and no longer be an add on.  But first it has to work the way users expect.

At the link above, you'll find my re-write of the code if you want to test this at the bottom, submitted today, which should allow you to easily patch in the Ctrl key modifier to test this yourself.

Thanks guys!
Comment 1 Howard Johnson 2017-04-22 18:48:58 UTC
Created attachment 132753 [details]
Example database which uses this event

Basic is currently setup with KM2 (Key Modifier 2) for Alt-Tick, but you can replace the =KM2 with =KM1 to make this use the Ctrl-Tick key-press event.
Comment 2 Alex Thurgood 2017-04-24 10:31:57 UTC
@Howard : please remember that the shortcut you are suggesting to integrate into the code is supposed to work across all platforms. The Ctrl-' (or Cmd-') shortcut does not copy down a value from a control into the cell below on Mac OSX.
Comment 3 Howard Johnson 2017-04-24 13:59:24 UTC
Any idea of how Calc handles this on Mac?  

(On my Debian X86 Linux when I type Ctrl-' into Calc it copies the cell above to my cell.  Alt-' doesn't do anything in Calc.)

I don't know how these things should be resolved.  Are these the options: a) dumb down the whole world to a mac (which never had an advanced database of it's own), b) require that the mac and linux be setup to work differently c) possibly try to make it work either way, i.e. allow either key combo to work, or d) just not have it work on mac, given that apple chose this limitation for themselves when they designed the mac.  :-(  I'm surprised that apples do not have a generic workaround to try to get them to work with software that could get ported to them that takes advantage of the ctrl key.  Is there not some special key combo on the mac to emulate ctrl-'?  

??
Comment 4 Alex Thurgood 2017-04-25 11:06:22 UTC
(In reply to Howard Johnson from comment #3)
> Any idea of how Calc handles this on Mac?  
> 

Well, my bluetooth Apple keyboard has both the Ctrl and Cmd keys so things might be looking up.

Ctrl-' does nothing, at least nothing that I can physically see in most parts of the system.

Cmd-' switches context or moves focus to next rightwards tab or downwards menu entry depending on the application that has focus.
Comment 5 Alex Thurgood 2017-04-28 07:21:54 UTC
Well I tried that attachment with

Version: 5.4.0.0.alpha0+
Build ID: 55833ef28adb67a34a61f545219f9ba9a7c1a4e5
CPU threads: 2; OS: Mac OS X 10.12.4; UI render: default; 
Locale: fr-FR (fr_FR.UTF-8); Calc: group

and couldn't get any of it to work. It didn't matter whether I tried Alt++, Alt+' or Ctrl+' (just in case you'd modified the file to work that way) - in each case, either nothing happened, i.e. no copy of the selected value or rowset occurred, or, as with Ctrl+', it just inserted (') symbols into the field I had selected. 

Of course, it might not be helped by the fact that my Apple keyboard doesn't have a numeric keypad with a plus symbol on it. If we are going to try and reproduce this problem, we need an example that at least works for everyone and is not dependent on some particular keyboard layout...
Comment 6 Alex Thurgood 2017-04-28 07:31:01 UTC
The basic macro execution doesn't work in

Version: 5.3.2.2
Build ID: 6cd4f1ef626f15116896b1d8e1398b56da0d0ee1
Threads CPU : 2; Version de l'OS :Mac OS X 10.12.4; UI Render : par défaut; Moteur de mise en page : nouveau; 
Locale : fr-FR (fr_FR.UTF-8); Calc: group

Again, I loaded up the file, enabled macros, selected the LastName cell of record 64, pressed Alt+' and all it did was insert the (') character into the cell.
Comment 7 Alex Thurgood 2017-04-28 08:08:29 UTC
Also tried using the original CopyFieldCloneRecordExample from:

https://forum.openoffice.org/en/forum/viewtopic.php?f=21&t=83531

to no avail.


Seems like the macro as it stands is non-functional on an Apple bluetooth keyboard, or else it just isn't working at all in the OSX versions of LibreOffice.
Comment 8 Alex Thurgood 2017-04-28 08:09:31 UTC
I even tried setting CAPSLOCK to on, as the + symbol is normally only reachable on such a keyboard via the Shift key.
Comment 9 Alex Thurgood 2017-04-28 08:42:02 UTC
Tested with

Version: 5.3.2.2
Build ID: libreoffice-5.3.2.2-snap1
CPU Threads: 4; OS Version: Linux 4.4; UI Render: default; VCL: gtk3; Layout Engine: new; 
Locale: fr-FR (C); Calc: group


I altered the included macro to activate KM1.
I then opened the form and selected a cell in the COUNTRY column.
Pressed the Ctrl-' keys and then clicked on the new record cell below. Re-pressed Ctrl-', nothing happened.

I repeated the experiment with the Combobox, the values of both Combobox and Country were inserted into my new record.

Either I am misunderstanding something here or it at least appears to workforme in this version on Linux Mint with the Ubuntu snap.
Comment 10 Howard Johnson 2017-04-30 00:02:34 UTC
"Of course, it might not be helped by the fact that my Apple keyboard doesn't have a numeric keypad with a plus symbol on it. If we are going to try and reproduce this problem, we need an example that at least works for everyone and is not dependent on some particular keyboard layout..."

Alex,

Good point.  At the moment this macro is only designed for a PC keyboard.  I overlooked this, as did the original author, but please read on.

A) Obvious facts:

  * The physical Apple/PC keyboards are different
  * And even for the same exact key codes the two OS's use these codes differently

B) Deduction from these facts:

  * Application software must allow for these differences,
  * This requires that LO on different platforms must operate differently (esentually your point above I think).

So the first answer is that the key(s) used on the mac and the pc will have to be different.

Given that the Ctrl-' has worked on PCs for 15 years, or so that I know of, this leaves one question:  Which is the best key to use for this feature on the apple?


As I'm not an expert on this, I will have to defer to someone like you, who has more experience w/ apple machines.  Can you suggest to me which key should be used on the Apple and I will try to install it into the macro?

I'll have to figure out how to detect which PC this is running on, and alter the software (and help and documentation) to make it work reasonably on both platforms.

Then, we can re-test on your machine.

Thanks again for your work on this.  I just love the feature of being able to copy a record, like in accounting to save lots of keystrokes.
Comment 11 Alex Thurgood 2017-05-03 07:57:42 UTC
So, I'm neither an expert nor a developer and haven't got the time to test every single possible keyboard combo. What I can do is point you to the Apple resources that indicate which combos are already reserved/attributed and their human interface guidelines :

https://developer.apple.com/library/content/documentation/UserExperience/Conceptual/OSXHIGuidelines/Keyboard.html

"As much as possible, avoid using the Control key. Because the Control key is already used by some of the universal access features—as well as in Cocoa text fields where Emacs-style key bindings are often used—it should be used as a modifier key only when necessary."

I do like the idea of being able to copy an entire rowset with a keyboard combo though, IMO a feature that could ideally be introduced directly into the C++ code, and for which there may already be an enhancement request.
Comment 12 Alex Thurgood 2017-05-03 07:58:39 UTC
Confirming that the Ctrl-' key doesn't fire the event on OSX.
Comment 13 Alex Thurgood 2017-05-11 07:00:56 UTC
See also bug 43680
Comment 14 QA Administrators 2018-05-12 02:28:36 UTC
** Please read this message in its entirety before responding **

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the information from Help - About LibreOffice.
 
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice.

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)


If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from http://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
4b. If the bug was not present in 3.3 - add 'regression' to keyword


Feel free to come ask questions or to say hello in our QA chat: https://kiwiirc.com/nextclient/irc.freenode.net/#libreoffice-qa

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team

MassPing-UntouchedBug