![]() |
@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 |
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. |
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. |
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:
Quote:
|
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]I'm just not certain how to proceed. |
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. |
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.
|
I confirm, that works!
Code:
set QT_QPA_PLATFORM=windows:altgr |
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. |
Quote:
Quote:
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. |
Quote:
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. |
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. |
Quote:
|
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 |
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");I don't want to play around with ifdefing for Windows and creating new preference settings if it's not going to work. |
| All times are GMT -4. The time now is 09:18 PM. |
Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.