Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 11-20-2023, 11:38 AM   #46
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,605
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by recook View Post
When a match is found, i can (with the new Focus shortcuts - thanks @DiapDealer!) type the new shortcut to focus the Codeview to edit the match.
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.
DiapDealer is offline   Reply With Quote
Old 11-26-2023, 02:17 PM   #47
philja
Zealot
philja began at the beginning.
 
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.
philja is offline   Reply With Quote
Advert
Old 11-26-2023, 04:58 PM   #48
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
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.
KevinH is offline   Reply With Quote
Old 11-26-2023, 07:55 PM   #49
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
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.
KevinH is offline   Reply With Quote
Old 11-27-2023, 09:21 AM   #50
philja
Zealot
philja began at the beginning.
 
Posts: 125
Karma: 10
Join Date: Nov 2015
Location: Europe EEC
Device: none
Quote:
Originally Posted by KevinH View Post
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.
I must confess that I have never used the 'Next File' and 'Previous File' shortcuts mostly because my usual editing experience involves going between non-consecutive files, chasing a particular thread in a book. So inevitably this involved clicking with a pointer tool. Now that we have been liberated from this dependence upon the mouse, I can transfer focus to the Browser and use the arrow keys to get to the next file I need and hitting return opens it in a new tab (I'm on Linux).

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.
philja is offline   Reply With Quote
Advert
Old 11-27-2023, 09:28 AM   #51
philja
Zealot
philja began at the beginning.
 
Posts: 125
Karma: 10
Join Date: Nov 2015
Location: Europe EEC
Device: none
Quote:
Originally Posted by KevinH. 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.
F2 on my Sigil in linux is the shortcut assigned to open an external xhtml editor.
philja is offline   Reply With Quote
Old 11-27-2023, 09:51 AM   #52
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,734
Karma: 5446592
Join Date: Nov 2009
Device: many
Quote:
Originally Posted by philja View Post
F2 on my Sigil in linux is the shortcut assigned to open an external xhtml editor.
You can of course change that in Sigil Preferences and it should depend on which widget has keyboard focus at that time. If focus is in the BookBrowser and one file is selected, F2 should in fact be passed to BookBrowser first who should process and absorb it since it has the focus. Only OS system shortcuts should be able grab focus from any widgets.

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.
KevinH is offline   Reply With Quote
Old 11-27-2023, 11:57 AM   #53
philja
Zealot
philja began at the beginning.
 
Posts: 125
Karma: 10
Join Date: Nov 2015
Location: Europe EEC
Device: none
Quote:
Originally Posted by KevinH View Post
You can of course change that in Sigil Preferences and it should depend on which widget has keyboard focus at that time. If focus is in the BookBrowser and one file is selected, F2 should in fact be passed to BookBrowser first who should process and absorb it since it has the focus. Only OS system shortcuts should be able grab focus from any widgets.

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.
I have never selected an external editor in Sigil's preferences because I'm quite happy editing directly in Code View. (Outside of Sigil, I use Bluefish.) But, in preferences, F2 is still attributed to the external editor - even though I haven't selected one. I removed that attribution - so that F2 was not used in the shortcuts at all.

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.
philja is offline   Reply With Quote
Old 11-27-2023, 11:59 AM   #54
philja
Zealot
philja began at the beginning.
 
Posts: 125
Karma: 10
Join Date: Nov 2015
Location: Europe EEC
Device: none
Quote:
Originally posted by KevinH. 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.
Right - I just rebuilt Sigil from git with your TOC modif. It works as I hoped - place focus into TOC, up and down with arrow keys to find the place to make an edit - hit return and that file opens in Code View. And even at the lower level section selected in the TOC. It's good as navigating using the HTML Contents page file without having to find and open that file.

Thank you KevinH

Last edited by philja; 11-27-2023 at 01:39 PM.
philja is offline   Reply With Quote
Old 11-27-2023, 12:26 PM   #55
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
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.
KevinH is offline   Reply With Quote
Old 11-27-2023, 01:18 PM   #56
philja
Zealot
philja began at the beginning.
 
Posts: 125
Karma: 10
Join Date: Nov 2015
Location: Europe EEC
Device: none
Quote:
Originally Posted by KevinH View Post
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.
Right - I have rechecked and tried two cases:

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.
philja is offline   Reply With Quote
Old 11-27-2023, 01:50 PM   #57
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
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.
KevinH is offline   Reply With Quote
Old 11-27-2023, 02:28 PM   #58
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
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.
KevinH is offline   Reply With Quote
Old 11-28-2023, 05:34 PM   #59
philja
Zealot
philja began at the beginning.
 
Posts: 125
Karma: 10
Join Date: Nov 2015
Location: Europe EEC
Device: none
Quote:
Originally Posted by KevinH View Post
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.
What will be the consequences of changing that default? Will that change the behaviour of the other shortcuts?
philja is offline   Reply With Quote
Old 11-28-2023, 05:51 PM   #60
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
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.

.
KevinH is offline   Reply With Quote
Reply

Tags
book view, code view, focus, keyboard shortcuts, preview


Forum Jump

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


All times are GMT -4. The time now is 10:42 AM.


MobileRead.com is a privately owned, operated and funded community.