Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 09-10-2021, 10:27 AM   #61
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: 5,767
Karma: 3571822
Join Date: Nov 2009
Device: many
@BeckyEbook,
When you get a free moment, please try with altgr in the command line with what I just pushed to master ...

Hopefully this change will make it somewhat more like Sigil-1.7 handling when altgr worked.

For those interested n what I added, here is the change just pushed to master to try to handle this case.

Code:
diff --git a/src/Dialogs/PreferenceWidgets/KeyboardShortcutsWidget.cpp b/src/Dialogs/PreferenceWidgets/KeyboardShortcutsWidget.cpp
index b7f77042..688189f6 100644
--- a/src/Dialogs/PreferenceWidgets/KeyboardShortcutsWidget.cpp
+++ b/src/Dialogs/PreferenceWidgets/KeyboardShortcutsWidget.cpp
@@ -276,6 +276,10 @@ void KeyboardShortcutsWidget::handleKeyEvent(QKeyEvent *event)
 
 
 #ifdef Q_OS_WIN32
+    if ((state & Qt::GroupSwitchModifier)) {
+        letter = "" + QChar(nextKey);
+        state = state & ~((int)Qt::GroupSwitchModifier);
+    }
     if ((state & Qt::ShiftModifier) && letter.toUpper() == letter.toLower()) {
         // remove the shift since it is included in the keycode
         state = state & ~Qt::SHIFT;
KevinH is online now   Reply With Quote
Old 09-10-2021, 10:47 AM   #62
BeckyEbook
Evangelist
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 466
Karma: 1497025
Join Date: Jan 2017
Location: Poland
Device: Kindle (Key3, PW2, PW3), Nook (ST, GLP), Kobo Touch, Tolino Vision 2
It's OK!
Now AltGr works as in 1.7.0 released, no garbage in the Shortcut input box.

The current changes do not require a workaround and manual correction of the sigil.ini file, and everything works. Though I'm only human, someone else should check it out.
BeckyEbook is online now   Reply With Quote
Old 09-10-2021, 11:04 AM   #63
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: 5,767
Karma: 3571822
Join Date: Nov 2009
Device: many
Wonderful!
Thank you for all your help on this!
I will clean up the code a bit to streamline it but leave in the qdebug stuff so that other people can test as well.
KevinH is online now   Reply With Quote
Old 09-10-2021, 11:32 AM   #64
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: 5,767
Karma: 3571822
Join Date: Nov 2009
Device: many
Yes, I think we should use a preference setting to effectively add this to the command line somehow so that international windows users can take advantage of this much more easily.


Quote:
Originally Posted by DiapDealer View Post
Is that a command-line parameter for running Sigil? This is the first I've heard of international keyboard users needing to add special parameters for running Sigil. Would most users even know how? If it's necessary, then we should probably find a way to load it programmatically via a pref setting rather than relying on people stumbling across an obscure parameter to the qwindow platform plugin. Can you point me to some documentation on that platform plugin parameter? I can't seem to find anything.
KevinH is online now   Reply With Quote
Old 09-10-2021, 11:41 AM   #65
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: 24,545
Karma: 167414566
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I'm not seeing any way to easily set the parameter at runtime with a preference. I've not come across any equivalent Qt::AA_ or anything. You can pass platform plugin arguments via a qt.conf file, though:

Code:
[Platforms]
WindowsArguments=altgr
And we can include a qt.conf file as an internal resource, but I'm not certain we could include logic to load different qt.conf files (or skip loading one entirely). Or if we could, I don't know if it would get loaded soon enough to effect the windows platform plugin.

I'm just not certain how to proceed.
DiapDealer is offline   Reply With Quote
Old 09-10-2021, 11:52 AM   #66
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: 24,545
Karma: 167414566
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
If @BeckyEbook can verify the parameter can be set using the QT_QPA_PLATFORM environment variable, we might be able to inject it (if it's not already set to something else) in main.cpp.

Assigning the variable a windows:altgr value should tell us if its even possible or not.
DiapDealer is offline   Reply With Quote
Old 09-10-2021, 11:52 AM   #67
BeckyEbook
Evangelist
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 466
Karma: 1497025
Join Date: Jan 2017
Location: Poland
Device: Kindle (Key3, PW2, PW3), Nook (ST, GLP), Kobo Touch, Tolino Vision 2
Or (maybe easier) – add logic to the .iss file and ask the user during installation whether he uses AltGr (right Alt) to enter diacritics or other national characters. Only interested users will select the checkbox.
BeckyEbook is online now   Reply With Quote
Old 09-10-2021, 12:03 PM   #68
BeckyEbook
Evangelist
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 466
Karma: 1497025
Join Date: Jan 2017
Location: Poland
Device: Kindle (Key3, PW2, PW3), Nook (ST, GLP), Kobo Touch, Tolino Vision 2
I confirm, that works!
Code:
set QT_QPA_PLATFORM=windows:altgr
However, the ability to add a parameter is also useful, so it's good to have both possibilities discovered.
BeckyEbook is online now   Reply With Quote
Old 09-10-2021, 12:14 PM   #69
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: 5,767
Karma: 3571822
Join Date: Nov 2009
Device: many
I looked at:

qtbase/src/plugins/platforms/windows/qwindowsintegration.cpp

And that is in the QPA platform plugin code and it is where that command line option is processed:

QWindowIntegration::DetectAltGrModifier but unless we use the QCommandLine processor and somehow in main.cpp before opening the QApplication we try and append "-platform windows:altgr" to the actual command line arguments, it might work but ... I am not sure even then it would be early enough.

Perhaps there is no easy way other than what the Sigil User's guide approach recommends.

Last edited by KevinH; 09-10-2021 at 12:17 PM.
KevinH is online now   Reply With Quote
Old 09-10-2021, 12:21 PM   #70
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: 24,545
Karma: 167414566
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by BeckyEbook View Post
I confirm, that works!
Code:
set QT_QPA_PLATFORM=windows:altgr
Great, thanks!

Quote:
Originally Posted by BeckyEbook View Post
However, the ability to add a parameter is also useful, so it's good to have both possibilities discovered.
The -platform command line option is supposed to override the QT_QPA_PLATFORM variable, so user customization should still be possible.

I'd like to avoid setting it up with InnoSetup options at install time if possible. I could probably finagle adding the command line option to the desktop shortcut that way, but I couldn't really take care of all the ways a user could potentially bypass the altgr parameter (even when they didn't want to bypass it) without doing a lot of registry meddling to make sure Sigil always ran with the option without fail.
DiapDealer is offline   Reply With Quote
Old 09-10-2021, 12:28 PM   #71
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: 24,545
Karma: 167414566
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by KevinH View Post
but ... I am not sure even then it would be early enough.

Perhaps there is no easy way other than what the Sigil User's guide approach recommends.
Just have to try, I guess. If it doesn't work, it doesn't work.

I've also been thinking about a simple C launcher for Sigil where things like environment variables, or command-line option could be easily set up before the real Sigil executable is run. Sort of like the launcher-script for Sigil on Linux, but compiled. I've got one for Windows somewhere that allows Sigil to be run with a portable prefs directory.

Last edited by DiapDealer; 09-10-2021 at 12:30 PM.
DiapDealer is offline   Reply With Quote
Old 09-10-2021, 12:40 PM   #72
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: 5,767
Karma: 3571822
Join Date: Nov 2009
Device: many
Perhaps at line 362 in our main.cpp we could copy both argc and argv and increment our version of argc and add the needed option to the end of our version of argv before passing them to MainApplication. I think the app name has already been set so our SettingsStore may be usable at that point.

But just a guess.
KevinH is online now   Reply With Quote
Old 09-10-2021, 12:48 PM   #73
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: 24,545
Karma: 167414566
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by KevinH View Post
Perhaps at line 362 in our main.cpp we could copy both argc and argv and increment our version of argc and add the needed option to the end of our version of argv before passing them to MainApplication. I think the app name has already been set so our SettingsStore may be usable at that point.

But just a guess.
I'll take a look. The SettingsStore should definitely be usable by then. I use it back at line 339 to set up the highdpi stuff.
DiapDealer is offline   Reply With Quote
Old 09-10-2021, 01:11 PM   #74
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: 5,767
Karma: 3571822
Join Date: Nov 2009
Device: many
My only fear is that windows does not use the normal argc, argv that macOS and Linux use since they get their arguments via an internal Windows (*W routine for wide chars).

Not sure if there is a Windows specific call to add additional arguments.

Edit:
It will probably not work given these comments in Qt source:

https://github.com/qt/qtbase/blob/b4...tion.cpp#L2412

Last edited by KevinH; 09-10-2021 at 01:51 PM.
KevinH is online now   Reply With Quote
Old 09-10-2021, 07:08 PM   #75
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: 24,545
Karma: 167414566
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
It seems to me that creating the QT_QPA_PLATFORM environment variable early enough in main.cpp just _might_ be working. It's just very hard for me to test without an actual international keyboard.

@BeckyEbook: can you try inserting the following line in main.cpp at line 363 (just before the MainApplication app(argc, argv); line):

Code:
qputenv("QT_QPA_PLATFORM", "windows:altgr");
And see if it works for you? Make sure you run Sigil without the -platform windows:altgr parameter.

I don't want to play around with ifdefing for Windows and creating new preference settings if it's not going to work.
DiapDealer is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[BUG] - M96 out of memory - [BUG] Alf77 Onyx Boox 5 02-05-2015 11:47 AM
Another bug that I wonder if others have seen PeterT Kobo Reader 16 06-08-2013 09:48 PM
DR800 Help, I've got a bug!! A bug on my screen!! Franky iRex 4 06-21-2011 11:45 AM
Embedded font bug or CSS bug in ADE JSWolf ePub 10 06-11-2011 02:34 PM
PRS-505 bug or eBookLib bug? porkupan Sony Reader 3 10-07-2007 10:44 PM


All times are GMT -4. The time now is 01:42 PM.


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