Description: Improvement suggestion: In Microsoft Word it is possible to mark text by pressing "F8": 1. press: nothing happens 2. press: marks the first word behind the cursor 3. press: marks the whole sentence the cursor is currently located in 4. press: marks the whole paragraph the cursor is currently located in 5. press: marks the whole text Steps to Reproduce: 1. open LibreOffice 2. Type/copy a text in a document 3. Press "F8": 1. press: nothing happens 2. press: marks the first word behind the cursor 3. press: marks the whole sentence the cursor is currently located in 4. press: marks the whole paragraph the cursor is currently located in 5. press: marks the whole text Actual Results: Nothing happens/is marked by pressing "F8" (several times) Expected Results: Marking of text by pressing "F8" multiple times Reproducible: Always User Profile Reset: No Additional Info: Windows Edition Windows 10 Home Version 1909 Installed on 17.02.2020 Operating system build 18363.1016 LibreOffice Version: 7.0.2.2 (x64) Build ID: 8349ace3c3162073abd90d81fd06dcfb6b36b994 CPU threads: 4; OS: Windows 10.0 Build 18363; UI render: Skia/Vulkan; VCL: win Locale: de-DE (de_DE); UI: de-DE Calc: threaded
The function would be very useful for people who need to use a keyboard, such as blind and visually impaired people. It would be great if this idea could be implemented!
This cyclic selection sequence is already provided, but is lmouse click based: 2 - word, 3 - sentence, 4 - paragraph in the editshell, not UNO based. There are direct UNO controls for selection that can be assigned Tools -> Customize dialog to keyboard shortcut, e.g. Select Word (uno:SelectWord), Select Sentence (uno:SelectSentence) , Select Paragraph (uno:SelectText). And I personally will assign a shortcut to Select Word for reduced mouse use. So I guess similar to the current <Shift>+<F3> 'Cycle Case' transliterations, a selection could be made cyclically to match the lmouse click selection. However LO already provides a very robust keyboard based block selection [1]. The <F8> is already assigned for Extended selection mode, <Shfit>+<F8> for Adding selection,, and <Ctrl><Shift>+<F8> for Block selection. Selections are extended with cursor <L,R,U,D> with modification using <Ctrl> and <Shift>. Current Selection-mode is available on the Status bar (which does require mouse action to expose the mode list and selection). But sure, a simple cyclic selection behavior with the existing UNO--even overloading the <F8> might be workable. +1 =-ref-= [1] https://help.libreoffice.org/7.1/en-US/text/shared/02/20050000.html?&DbPAR=WRITER
(In reply to V Stuart Foote from comment #2) > But sure, a simple cyclic selection behavior with the existing UNO--even > overloading the <F8> might be workable. Do you have F8 in mind for toggling uno:SelectWord > SelectSentence > SelectText > SelectWord... (not sure it unselects the text) or to combine the current F8 shortcuts? Guess the first- reassign F8 in this case?
Sure, reuse the <F8>. @Cor?
(In reply to Heiko Tietze from comment #3) > (In reply to V Stuart Foote from comment #2) > > But sure, a simple cyclic selection behavior with the existing UNO ... > Do you have F8 in mind for toggling uno:SelectWord > SelectSentence > > SelectText > SelectWord... (not sure it unselects the text) ... Good idea. +1 The last step before new beginning of the cycle should be 'nothing selected'.
We discussed Stuart's proposal to toggle the selection in the design meeting and welcome the idea. Would be good to use F8 to comply with MSO (and change Extend Selection to use Alt+F8) but alternatively also vice versa. Jim, could you please add some code pointers? Think it's a medium difficult easy hack.
I think this is a nice opportunity for some fun LO hacking indeed :-) Here are some code pointers: A user command for this will be needed. Perhaps .uno:CycleSelection or .uno:SelectionCycle? Feel free to chime in with a better command name. An example how to add a Writer user interface command is here: https://gerrit.libreoffice.org/c/core/+/91605 Details of how this works is here: https://wiki.openoffice.org/wiki/Framework/Article/Implementation_of_the_Dispatch_API_In_SFX2 Look here to do the implemention of the command: sw/source/uibase/uiview/view2.cxx void SwView::ExecuteSfxRequest &rReq) The original cursor position, point and mark positions of the selection cycle, and selection cycle step number will be useful to store. A struct with a member variable assigned in the SwView class might work well for this purpose. Any selection(s) when the cycle is initiated should be cleared and word selection should be done from current cursor position. If point and/or mark positions are changed before the next selection cycle step the cycle step should return to word selection. The following functions will be of use to cycle selection thru word, sentence, and paragraph and to set the cursor to the original cursor position with no selection. sw/inc/crsrsh.hxx SwCursorShell::GetCursor_ SwCursorShell::SetCursor sw/inc/viscrs.hxx SwShellCursor::GetPtPos SwShellCursor::GetMkPos sw/source/uibase/inc/wrtsh.hxx SwWrtShell::IsSelection SwWrtShell::MoveCursor SwWrtShell::SelWrd SwWrtShell::SelSentence SwWrtShell::SelPara
(In reply to Jim Raykowski from comment #7) > Any selection(s) when the cycle is initiated should be cleared and word > selection should be done from current cursor position. Maybe not clearing the current selections, like the ctrl+lmouse multiclicks behavior, is better. SwCursorShell::ClearMark should be useful for implementing this behavior and SwWrtShell::IsSelection and SwWrtShell::MoveCursor not needed. FWIW: sw/soure/uibase/docvw/edtwin.cxx SwEditWin::MouseButtonDown is where the mouse multiclicks selection is implemented.
Hi, I would like to work on this.
Hi, I have added a command .uno:SelectionCycle and also implemented it in void SwView::ExecuteSfxRequest &rReq). I have a question. Currently I am able to see a command 'Cycle Select' in writer commands. But it is not assigned to any key. I am not sure where this assignment of key to command is coded. Can you please help me?
(In reply to Dipanshu Garg from comment #10) > ... where this assignment of key to command is coded UNO commands can be assigned to a hard-coded shortcut in officecfg/registry/data/org/openoffice/Office/Accelerators.xcu.
dipanshu124 committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/d97528da0c70c43fccd3239cbe8e064c3480bba8 tdf#137494 Add Select Cycle uno command It will be available in 7.2.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.
It's ok except that it is working like this: 1. press: nothing happens <--- OK 2. press: marks the first word behind the cursor <--- OK 3. press: marks the whole sentence the cursor is currently located in <--- OK 4. press: marks the whole paragraph the cursor is currently located in <--- OK 5. press: marks the whole text <------ this is NOT happening in 7.2.0 Tested in Version: 7.2.0.0.alpha1+ (x64) / LibreOffice Community Build ID: 3b57ebb445df8a2bc3d916ea79f8af45e20e4e62 CPU threads: 4; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win Locale: ro-RO (ro_RO); UI: en-US Calc: threaded Could someone test this?
(In reply to BogdanB from comment #13) > It's ok except that it is working like this: > ... > Could someone test this? Yes and that is implemented as intended, and there is absolutely no requirement for a 5th <F8> to 'Select All'; the keyboard shortcut for that is the ubiquituous <Ctrl>+A. MS has a much different 'Selection' model for <F8> which we do not follow. And after doing an 'all' selection its <F8> cycling does not get back to a 'none'. Clearing the selection reuiqres reversing backward with <Shitf>+<F8>, or moving the mouse cursor and making a different selection. Our LO Implementation is cleaner and follows our mouse click cycling of word, sentence, paragrapha, none. And keeps document focus within the current paragraph--much simpler UI. Version: 7.2.0.0.alpha1+ (x64) / LibreOffice Community Build ID: 3b57ebb445df8a2bc3d916ea79f8af45e20e4e62 CPU threads: 8; OS: Windows 10.0 Build 19042; UI render: Skia/Vulkan; VCL: win Locale: en-US (en_US); UI: en-US Calc: threaded
Ok, then. Thanks for fixing this bug. It's verified in Version: 7.2.0.0.alpha1+ (x64) / LibreOffice Community Build ID: 3b57ebb445df8a2bc3d916ea79f8af45e20e4e62 CPU threads: 4; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win Locale: ro-RO (ro_RO); UI: en-US Calc: threaded