Bug 123159 - Accessibility: No keyboard shortcut to open a HYPERLINK in Calc cells
Summary: Accessibility: No keyboard shortcut to open a HYPERLINK in Calc cells
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: andreamassimo03
URL:
Whiteboard: target:24.8.0
Keywords: accessibility, difficultyInteresting, easyHack, skillCpp, topicCleanup
Depends on:
Blocks: a11y, Accessibility
  Show dependency treegraph
 
Reported: 2019-02-04 14:18 UTC by Oliver Keim
Modified: 2024-05-03 14:27 UTC (History)
12 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample with generated link (9.74 KB, application/vnd.oasis.opendocument.spreadsheet)
2019-02-04 14:29 UTC, Oliver Keim
Details
Sample file with URL for the discussion in https://gerrit.libreoffice.org/c/core/+/157666 (10.05 KB, application/vnd.oasis.opendocument.spreadsheet)
2023-10-21 21:26 UTC, Michael Weghorn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Keim 2019-02-04 14:18:36 UTC
Description:
I have a cell, which calculates a hyperlink based on a base address which resides in a named cell. The URL is contatenated with a ticket number which resides in C* cells. The number contains spaces, thus the spaces are removed before added to thebase url.

=HYPERLINK(CONCATENATE(baseAddressUrl,SUBSTITUTE(C8," ","")),"link")

The resulting URL works and opens fine in a browser, when clicking with the mouse.

However, how can the URL get triggered by using a keyboard only?

It seems there is a mouse-action which does not have a counterpart on the keyboard - which seems to be an accessibility issue.


Steps to Reproduce:
1. add a cell, type in a url, and add a name to the cell, "baseAddressUrl".
2. add a new row and a cell with a number, use cell !C4! for example and type "123456"
3. on column D add the following macro: =HYPERLINK(CONCATENATE(baseAddressUrl,SUBSTITUTE(C4," ","")),"link")
4. click on cell !D4!. A browser opens and shows a url
5. try to have the browser opens the url by just using the keyboard....

Actual Results:
nothing, there seems no keyboard access to triggering HYPERLINK elements within Calc. I read it seems to work in Writer, but I did not check this.

Expected Results:
A keyboard shortcut is given by the LibreOffice team which maps into the keyboard shortcuts interaction design patterns and lets end users trigger a link by just using the keyboard.


Reproducible: Always


User Profile Reset: No



Additional Info:
As written, a shortcut should open the browser, congruent to the use of the mouse.
Comment 1 Oliver Keim 2019-02-04 14:29:01 UTC
Created attachment 148882 [details]
Sample with generated link

Sample which contains a column with a generated link. Click on link->works.
Try to open by only using the keyboard. I was not able to achieve this.
How can users with screen readers open such links?
Comment 2 Oliver Keim 2019-02-05 08:57:39 UTC
added as "bug request" not as "feature request", as LibreOffice is designed to be accessible and in this case a keyboard-alternative for a mouse action seems to be missing. 

Related Accessibility-Requirements:
WCAG 2.0, 2.1.1
WCAG 2.0, 2.1.1
BITV 2.0, 2.1.1
Section508; 1194.21 (a)
Section508; 1194.21 (l)
Section508; 1194.22 (e)
Section508; 1194.22 (f)
Section508; 1194.22 (n)
Comment 3 m_a_riosv 2019-02-05 09:15:34 UTC
The keyboard shortcut it's Ctrl+Click, what can be change in Menu/Tools/Options/LibreOffice/Security/Security Options & warnings - Optins - Ctrl+Click required to follow hyperlinks.
If disable only click is needed.
Comment 4 Oliver Keim 2019-02-05 10:31:29 UTC
The inquiry was about keyboard access.

The given solution was to change from Ctrl+Click to Click, which is a mouse option.

I am looking for a KEYBOARD ALTERNATIVE to trigger a link by only using the keyboard. The computer in use does neither have a mouse pointing device or a touch pad.
Comment 5 Xisco Faulí 2019-02-06 17:59:24 UTC
You can't confirm your own bugs. Moving it back to UNCONFIRMED until someone
else confirms it.
Comment 6 Alex ARNAUD 2019-02-16 14:06:04 UTC
I can confirm the issue. In this case, I think enter ou control + enter should make it possible to trigger the click on the navigation mode.

Best regards,
Alex.
Comment 7 Heiko Tietze 2019-02-19 09:39:59 UTC
The usual way of a11y is to press enter on focused links, or ctrl/cmd+enter in our case. That's easy for whole cells  but might be a bit tricky for cell content with for example "Hello" <a href=...>foo</a> World".

But we should definitely go for it.
Comment 8 QA Administrators 2021-09-04 04:01:34 UTC Comment hidden (obsolete)
Comment 9 Oliver Keim 2021-09-08 12:39:02 UTC
Reviewed the current version 7.2.0 of LibreOffice Calc for macOS. Used macOS as this OS is the preferred version to efficiently work with large documents and keyboard-only access.

I added a link using CMD+K and added a http: or https: based URL (such as "http://www.cnn.com" and added a text ("CNN"). Closed the dialog with OK.

While the focus resides on the cell which contains the URL there is no keyboard option to trigger the link. Not directly on the cell (preferred), not indirectly in a context menu (press Shift+F10), not indirectly in the CreateLink dialog (press CMD+K).

Tried the following shortcuts:
- ALT+ENTER - no result
- CTRL+ENTER - no result
- CMD+ENTER - no result.

Test was done in macOS version of LibreOffice.

Best regards, Oliver.
Comment 10 Heiko Tietze 2021-09-09 08:32:05 UTC
The function ScGlobal::OpenURL() is called in ScGridWindow::MouseButtonUp(). Cleanest solution would be to separate the part that takes various situations into account. But this is some effort since it's closely linked to the mouse position. Alternatively, we might simulate a mouse click in the UNO command that needs to be added for the keyboard interaction. Or duplicate the code maybe with limited capabilities (no VbaEvents, no mobile device.

Eike, what do you think?
Comment 11 Heiko Tietze 2021-09-09 08:32:42 UTC Comment hidden (obsolete)
Comment 12 Oliver Keim 2021-09-09 11:11:58 UTC
Also reviewed version 7.2.0.4 LibreOffice on Windows.
The result is consistent to macOS: The shortcuts do not yet trigger a link.

Ctrl+Enter/Cmd+Enter and Alt+Enter/Option+Enter seem unmapped in Calc right now, so one of these keystrokes may be an option.

In Writer the user can at least use Shift+F10 to access the context menu and trigger the context menu function "Open Hyperlink" and "Copy Hyperlink Location". A consistent implementation in Calc would surely be appreciated by our users.
Comment 13 Heiko Tietze 2021-09-09 12:00:09 UTC
(In reply to Oliver Keim from comment #12)
> In Writer the user can at least use Shift+F10 to access the context menu...

The context menu offers Open Hyperlink as well in Calc. Also a good solution, and available for customization right now. However, ctrl+return or ctrl+shift+G (some other shortcut) don't work for me.

Version: 7.2.0.4 / LibreOffice Community
Build ID: 20(Build:4)
CPU threads: 8; OS: Linux 5.13; UI render: default; VCL: kf5 (cairo+xcb)
Locale: de-DE (en_US.UTF-8); UI: en-US
7.2.0-2
Calc: threaded
Comment 14 Heiko Tietze 2021-09-09 12:04:57 UTC
Btw, ctrl+K is the same as Edit Hyperlink but not customizable (neither assigned).
Comment 15 Eike Rathke 2021-09-10 12:57:34 UTC
(In reply to Heiko Tietze from comment #13)
> The context menu offers Open Hyperlink as well in Calc.
Only if a link is selected within the cell content containing a hyperlink field. Not on a formula cell containing the HYPERLINK() function. For example

=HYPERLINK("https://example.com/";"open me")


(In reply to Heiko Tietze from comment #14)
> Btw, ctrl+K is the same as Edit Hyperlink but not customizable (neither
> assigned).
Not relevant here.
Comment 16 Heiko Tietze 2021-09-13 09:22:05 UTC
(In reply to Eike Rathke from comment #15)
> Not on a formula cell containing the HYPERLINK() function.

And what's your take on comment 10?
Comment 17 Eike Rathke 2021-09-13 13:07:45 UTC
Implementation detail..

(In reply to Heiko Tietze from comment #10)
> The function ScGlobal::OpenURL() is called in ScGridWindow::MouseButtonUp().
> Cleanest solution would be to separate the part that takes various
> situations into account. But this is some effort since it's closely linked
> to the mouse position.
The mouse position there is only needed to obtain the URL from the cell via ScGridWindow::GetEditUrl() and for the tiled rendering case. Separating that out and factoring out all the address conversion then would only need a GetEditUrl() on the currently active cell for the keyboard case.

For ScGlobal::OpenURL() it's about the active view shell/frame and mouse click modifier keys. The view shell/frame is the same for a Ctrl+Enter (or whatever) and whether to evaluate the mouse click modifier (and what happens if not) could be made a parameter, defaulted to current behaviour.

> Alternatively, we might simulate a mouse click in the
> UNO command that needs to be added for the keyboard interaction.
How should that work? You'd have to navigate the mouse to position it on cells to emulate the click. Sounds more like a pain than a gain.

> Or
> duplicate the code maybe with limited capabilities (no VbaEvents, no mobile
> device.
That does not sound like a good idea..
Comment 18 Heiko Tietze 2021-09-13 14:03:34 UTC
(In reply to Eike Rathke from comment #17)
> The mouse position there is only needed to obtain the URL from the cell via
> ScGridWindow::GetEditUrl() and for the tiled rendering case...

Okay, so let's do. Sounds like an interesting easy hack.
Comment 19 andreamassimo03 2023-03-02 16:46:56 UTC
I'm a beginner developer and I am trying to implement this change following the strategy outlined above. 
I have a few questions about it.

Since the name of the function is MouseButtonUp, it would seem related to a mouse functionality. Is that the right place to add the "CTRL+Enter" keyboard combination, or should I find a better place for it?

Then, about the GetEditUrl function:

> The mouse position there is only needed to obtain the URL from the cell via
> ScGridWindow::GetEditUrl() and for the tiled rendering case. Separating that
> out and factoring out all the address conversion then would only need a
> GetEditUrl() on the currently active cell for the keyboard case.

Should I just find a way to express the active cell without using the mouse and 
replace rMEvt.GetPosPixel() with that?

And finally, about OpenURL:

> For ScGlobal::OpenURL() it's about the active view shell/frame and mouse
> click modifier keys. The view shell/frame is the same for a Ctrl+Enter (or
> whatever) and whether to evaluate the mouse click modifier (and what happens
> if not) could be made a parameter, defaulted to current behaviour.

From what I've seen OpenURL() takes two main arguments: aUrl and aTarget.
They are both initialized as OUString without any values and used immediately in GetEditURL(). Where is the mouse click modifier? I don't understand that final part.
Comment 20 Michael Weghorn 2023-10-21 21:26:03 UTC
Created attachment 190368 [details]
Sample file with URL for the discussion in https://gerrit.libreoffice.org/c/core/+/157666
Comment 21 Commit Notification 2024-03-28 20:42:36 UTC
Sahil Gautam committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/14396a5361ef72afc99033d4cac29aaeb1ffa2d8

tdf#123159 Make Hyperlinks keyboard accessible

It will be available in 24.8.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.