Bug 102307 - F3 is hardcoded as Find next but not defined as the shortcut for uno:RepeatSearch
Summary: F3 is hardcoded as Find next but not defined as the shortcut for uno:RepeatSe...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: framework (show other bugs)
Version:
(earliest affected)
5.2.1.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Shortcuts-Accelerators Find-Search
  Show dependency treegraph
 
Reported: 2016-09-20 06:50 UTC by mahfiaz
Modified: 2025-03-31 13:18 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 mahfiaz 2016-09-20 06:50:44 UTC
1. Open Calc or Writer
2. Ctrl + F to open quick search toolbar and activate
3. Search something, end with Enter
4. Press F3 to find next
5. Click inside document
6. Press F3 to find again. No boom. Either nothing happens or F3 has another use now.

I think whatever shortcut we use (F3 and Ctrl+G are generally common ones), it should work even when cursor is not inside search box.
Comment 1 V Stuart Foote 2016-09-21 18:14:43 UTC
F3 is undefined--both Globally and in Calc--it has no Find function in LibreOffice.

And, <Ctrl>+G *is* the defined shortcut for "Repeat Search" and functions from the Find toolbar (<Ctrl>+F) and the Find & Replace dialog (<Ctrl>+H)

You can of course customize your Keyboard to assign F3 to Repeat Search if you prefer--but we wont make it a default assignment as that would duplicate the <Ctrl>+G already used.
Comment 2 mahfiaz 2016-09-25 05:57:48 UTC
Put cursor back to search box and F3 will work (until your cursor is there). That's the problem.
Comment 3 V Stuart Foote 2016-09-25 16:24:13 UTC
As mentioned the behavior you seek is *already* provided with a customizable short cut assigned to the "Repeat Search" action--i.e. .uno:RepeatSearch.

On Windows builds that is already <Ctrl>+G by default, and on RPM builds it is to <Ctrl>+<Shift>+F; simply set the shortcut you prefer from Tools -> Customize -> Keyboard: Edit Functions, "Repeat Search"

F3 is *not* assigned to a LibreOffice search related shortcut action in any module, nor used in LibreOffice globally for an action. 

It has some specific uses--notably in Calc to move between errors, and in Draw/Impress to enter a group of objects.

The behavior of the F3 key executing find--e.g. .uno:RepeatSearch--while in the FindBar with cursor focus in the TextFind widget is anomalous in that it is not assigned as a shortcut, but is being parsed in the source code of the widget. This anomoly is present in both Windows and Linux builds and affects Writer and Calc.

Adjusting summary for that issue.
Comment 4 mahfiaz 2016-09-25 16:31:57 UTC
I think whatever happens should be consistent. So I vote for removal of F3 doing anything in this context.
Comment 5 QA Administrators 2017-10-23 14:14:00 UTC Comment hidden (no-value, obsolete)
Comment 6 mahfiaz 2019-03-30 18:05:19 UTC
It still happens in 6.2.2.2

svx/source/tbxctrls/tbunosearchcontrollers.cxx@269

            // Execute the search when Return, Ctrl-G or F3 pressed
            if ( KEY_RETURN == nCode || (bMod1 && (KEY_G == nCode)) || (KEY_F3 == nCode) )

should be:

            // Execute the search when Return or Ctrl-G is pressed
            if ( KEY_RETURN == nCode || (bMod1 && (KEY_G == nCode)) )
Comment 7 QA Administrators 2021-03-30 03:39:20 UTC Comment hidden (obsolete)
Comment 8 QA Administrators 2023-03-31 03:29:17 UTC Comment hidden (obsolete)
Comment 9 mahfiaz 2023-03-31 07:50:57 UTC
The bug is still there in 7.5.2.2. The patch is in my previous comment.
Comment 10 QA Administrators 2025-03-31 03:12:09 UTC Comment hidden (obsolete)
Comment 11 V Stuart Foote 2025-03-31 11:39:56 UTC
My comment 1 and comment 3 regards the UNO assignment were off topic.

For legacy Find use, the F3 key is hardcoded (as Key_F3) assigned at tbunosearchcontrollers.cxx#301 to activate the Find bar, so non-customizable.

<F3> and <Shift><F3> Find next and find previous movements are held over from legacy MS Word handling (since removed IIUC), but they remain in common use, e.g. for Notepad and the Visual Basic Editor as well as new Visual Studio Code for Find Next and Find Previous. 

However, case can be made as in OP that behavior seems wrong. But not the assignment of the <F3>, but that its behavior changes depending on *edit cursor* focus.

When the Find bar tb has edit cursor focus, the <F3/Shift+F3> pair perform the next/previous Find actions. But with Find tb open, but edit cursor shifted onto canvas, the text at cursor position becomes the new search target and throws an info warning 'AutoText for shortcut <selected text> not found'.

And when UI is not focused to document canvas (e.g. is on Main menu or Std Toolbar)--the F3 pair then have no action.

Likewise get the same behavior when edit cursor is not on the Find bar affecting the <Ctrl>+G/<Shift><Ctrl>+G Find next/previous shortcuts. Except that the <Ctrl>+G is now assigned and when on document canvas now launches the GoTo page dialog.

A this point, I don't think removing the <F3> pair would be correct, it is not a bug. They are valid common shortcut. But maybe should be bound to the Find bar being open even if unfocused, and the Find next/previous not dependent on edit cursor and UI focus placement? 

As in OP "... it should work even when cursor is not inside search box."
Comment 12 V Stuart Foote 2025-03-31 11:56:53 UTC
(In reply to V Stuart Foote from comment #11)

>... But with Find tb open, but edit cursor
> shifted onto canvas, the text at cursor position becomes the new search
> target and throws an info warning 'AutoText for shortcut <selected text> not
> found'.

And that looks to be a collision with the AutoText feature in Writer for the .uno:ExpandGlossary 'Run Auto Text Entry'. 

Hmm, I'd imagine the F3 as Find Next really does need to be bound to focus of the Find bar as is, and this becomes a Wont fix.
Comment 13 Heiko Tietze 2025-03-31 12:32:11 UTC
There might be conflicts but I see no good reason for hard-coded shortcuts.
Comment 14 V Stuart Foote 2025-03-31 13:18:42 UTC
(In reply to Heiko Tietze from comment #13)
> There might be conflicts but I see no good reason for hard-coded shortcuts.

You mean liike <F6> and <F10>? ;-)  

Or even <F1>, <Ctrl>+W, <Ctrl>+Q, <Ctrl>+C, <Ctrl>+V, <Ctrl>+X, <Ctrl>+F, <Ctrl>+H, and etc. [1]

Hard-coded are user expectations, warts and all including headache(s) of localization(s).

=-ref-=

[1] https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts#Text_editing