11-20-2023, 11:38 AM | #46 |
Grand Sorcerer
Posts: 27,605
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I can't take the credit. Kevin added the shortcuts. Then Becky and he tweaked them.
Last edited by DiapDealer; 11-20-2023 at 11:41 AM. |
11-26-2023, 02:17 PM | #47 |
Zealot
Posts: 125
Karma: 10
Join Date: Nov 2015
Location: Europe EEC
Device: none
|
I've just rebuilt Sigil (in my UbuntuStudio 2204 LTS) with these latest modifications and assigned my shortcuts. They work a treat and will be very useful.
Thanks, KevinH. There is, however, what I consider to be one little anomaly. When the focus is switched to the BookBrowser, I can navigate up and down with the arrow keys and then hit enter to open the selected file. But when I navigate to the TOC, and move up and down with the arrow keys, hitting return does not open the selected chapter. I have to leave the keyboard, move to the trackball and click on the TOC item. Shouldn't I be able to simply hit return as in the Book Browser? Last edited by philja; 11-26-2023 at 03:34 PM. |
Advert | |
|
11-26-2023, 04:58 PM | #48 |
Sigil Developer
Posts: 7,734
Karma: 5446592
Join Date: Nov 2009
Device: many
|
When I do that (hit enter in BookBrowser) it does a file rename as it was designed to do to make fast, only keyboard, renaming possible (much like a spreadsheet).
There are already keyboard shortcuts to open the previous or next BookBrowser file in a tab (without need to move focus to the BookBrowser first). And keyboard shortcuts to close and open previous and next tabs, again with focus never having to leave CodeView. So if you want to navigate someplace and open a new tab, you can already do that via the keyboard with no need to change focus. Since the Table of Contents is a generated table, navigating via BookBrowser or keyboard shortcuts from CodeView would be more complete and is already possible. So how would hitting return/enter in BookBrowser be equivalently handled in the TableOf Contents and why is it really needed since keyboard equivalents already exist. If others agree it should act like a mouse click, that is easily doable but I really hate to add redundant ways to accomplish navigation from the keyboard. The Sigil UI is complicated enough. But I am willing to be swayed if others agree with you. Last edited by KevinH; 11-26-2023 at 07:09 PM. |
11-26-2023, 07:55 PM | #49 |
Sigil Developer
Posts: 7,734
Karma: 5446592
Join Date: Nov 2009
Device: many
|
Actually I checked the QAbstractItemView source code in Qt and the editKey on macOS is the Return or Enter, while on other platforms it appears to be F2.
And the activatedKey on macOS is Apple-O and on other platforms it appears to be the Return or Enter keys. So what the shortcut used here does is quite different depending on platform. So on Windows/Linux using Enter in BookBrowser will open a tab while on macOS will open that file name for editing which is why I did not see the parallelism. Last edited by KevinH; 11-26-2023 at 07:59 PM. |
11-27-2023, 09:21 AM | #50 | |
Zealot
Posts: 125
Karma: 10
Join Date: Nov 2015
Location: Europe EEC
Device: none
|
Quote:
But in practice, the various files in an epub have generic names like Chapter-x.xhtml which are displayed in the Book Browser, and these are not very informative as to the contents. I do realise that we can edit these generic names, but that's an additional job. The TOC shows actual book content and often at several levels of depth which permits better navigation. Our liberation permits getting direct focus on the TOC and it would be good if a hit on Enter could open the selected chapter in the Code Pane. Your next post indicates significant differences between Windows/Linux platforms and MacOS. I'm speaking for myself on linux and my reasons are based on my editing practices. Last edited by philja; 11-27-2023 at 10:07 AM. |
|
Advert | |
|
11-27-2023, 09:28 AM | #51 | |
Zealot
Posts: 125
Karma: 10
Join Date: Nov 2015
Location: Europe EEC
Device: none
|
Quote:
|
|
11-27-2023, 09:51 AM | #52 | |
Sigil Developer
Posts: 7,734
Karma: 5446592
Join Date: Nov 2009
Device: many
|
Quote:
Please give that a try (highlight a file in BookBrowser when it has been given focus using the new focus on Bookbrowser key sequence and hit F2). It should allow you to edit the file name and not launch the External Editor. But to tell you the truth, Qt's whole idea of a platform specific "edit key" and a platform specific "activation" key are strange imho. I would never think to hit Apple-Shift-O to "activate anything" where as hitting Enter or Return once something is selected seems intuitive. Since the change to allow "activation" in the TableOfContents is only a one line change, I have pushed that change to master for the next release. Please verify it works for you if you build from master - just update to the latest copy of Sigil/src/MainUI/TableOfContents.cpp - the only change is there. Last edited by KevinH; 11-27-2023 at 10:18 AM. |
|
11-27-2023, 11:57 AM | #53 | |
Zealot
Posts: 125
Karma: 10
Join Date: Nov 2015
Location: Europe EEC
Device: none
|
Quote:
Now, giving focus to Book Browser with your recent mods, and then using F2 does put me into file name editing within the Browser pane, as you predicted. |
|
11-27-2023, 11:59 AM | #54 | |
Zealot
Posts: 125
Karma: 10
Join Date: Nov 2015
Location: Europe EEC
Device: none
|
Quote:
Thank you KevinH Last edited by philja; 11-27-2023 at 01:39 PM. |
|
11-27-2023, 12:26 PM | #55 |
Sigil Developer
Posts: 7,734
Karma: 5446592
Join Date: Nov 2009
Device: many
|
If F2 even when set in Preferences for External Editor triggers it when keyboard focus is clearly in BookBrowser (and not grabbed back by CodeView) that is a bug by the definition of "keyboard focus". It should be processed and absorbed by BookBrowser.
Please double check that for me. Please try assigning F2 to ExternalEditor in Preferences and restart Sigil. The use focus on BookBrowser key sequence to bring focus to a file in BookBrowser (maybe use arrow keys to select one) then hit F2. It really should allow that file name to be edited. If not, maybe something is broken in Sigil's shortcut processing on your platform. |
11-27-2023, 01:18 PM | #56 | |
Zealot
Posts: 125
Karma: 10
Join Date: Nov 2015
Location: Europe EEC
Device: none
|
Quote:
1. F2 attributed as a keyboard shortcut but without providing a path to an external editor. Then restart Sigil. 2. F2 attributed as a keyboard shortcut linked to my bluefish editor. Then restart Sigil. After each restart, I moved the focus about a few times and then moved it to the Browser. I arrowed down to another file and hit F2. In case #1, nothing happened at all. In case #2, the external editor was launched to edit the tab which was already open in Code View and NOT the file further down which I had selected with the arrow key. If, having arrowed down to a file in the Browser, I hit enter to open it in the Code View and then hit F2, bluefish opens with the correct file. Of course, by hitting enter, focus was transferred to the Code View. So it looks like, in my UbuntuStudio at least, F2 if assigned to an external editor will always try to open the editor. If no editor has been assigned, then nothing happens. In none of these cases did F2 allow editing of the filename of the selected file in Book Browser, despite Browser having focus. PS. See my previous post for the rebuild with your TOC mod. |
|
11-27-2023, 01:50 PM | #57 |
Sigil Developer
Posts: 7,734
Karma: 5446592
Join Date: Nov 2009
Device: many
|
Thank you for your testing and info. Obviously something strange is going on with some Sigil shortcuts not following keyboard focus according to the rules.
I will start looking into it. |
11-27-2023, 02:28 PM | #58 |
Sigil Developer
Posts: 7,734
Karma: 5446592
Join Date: Nov 2009
Device: many
|
This shortcut not following keyboard focus behaviour is caused by the fact that all Sigil created QShortcuts defaulting to:
Qt::WindowContext instead of: Qt::WidgetContext because all QDockWidgets are children of the MainWindow. I will need to look further into that. |
11-28-2023, 05:34 PM | #59 | |
Zealot
Posts: 125
Karma: 10
Join Date: Nov 2015
Location: Europe EEC
Device: none
|
Quote:
|
|
11-28-2023, 05:51 PM | #60 |
Sigil Developer
Posts: 7,734
Karma: 5446592
Join Date: Nov 2009
Device: many
|
Haven't changed anything related to context yet, nor will I without some serious testing.
If I do decide to change things, I am thinking of allowing the Context to be controllable by Sigil Preferences or straight code. A much more likely and simpler/safer change would be remove F2 as the default shortcut for anything set by Sigil Preferences as it is reserved as the Qt "editKey" for Windows and Linux. That change will only impact new users and of course could be put back by those new users by using Sigil Preferences. For current users, they would need to decide to make that change in there own Preferences. . |
Tags |
book view, code view, focus, keyboard shortcuts, preview |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Book-details panels and keyboard focus | BetterRed | Library Management | 3 | 05-12-2023 03:22 AM |
Keyboard Shortcuts request | David Kudler | Sigil | 2 | 08-07-2020 06:09 PM |
feature request - Shortcuts for Plugins | Camelot | Sigil | 12 | 12-28-2015 04:50 AM |
keyboard shortcuts | vikischeldrup | Library Management | 4 | 08-23-2013 04:55 AM |
feature request - switch templates | kgn | Calibre | 8 | 07-23-2010 09:17 AM |