09-10-2021, 10:27 AM | #61 |
Sigil Developer
Posts: 7,654
Karma: 5433388
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; |
09-10-2021, 10:47 AM | #62 |
Guru
Posts: 692
Karma: 2180740
Join Date: Jan 2017
Location: Poland
Device: Misc
|
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. |
Advert | |
|
09-10-2021, 11:04 AM | #63 |
Sigil Developer
Posts: 7,654
Karma: 5433388
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. |
09-10-2021, 11:32 AM | #64 | ||
Sigil Developer
Posts: 7,654
Karma: 5433388
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:
Quote:
|
||
09-10-2021, 11:41 AM | #65 |
Grand Sorcerer
Posts: 27,552
Karma: 193191846
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 I'm just not certain how to proceed. |
Advert | |
|
09-10-2021, 11:52 AM | #66 |
Grand Sorcerer
Posts: 27,552
Karma: 193191846
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. |
09-10-2021, 11:52 AM | #67 |
Guru
Posts: 692
Karma: 2180740
Join Date: Jan 2017
Location: Poland
Device: Misc
|
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.
|
09-10-2021, 12:03 PM | #68 |
Guru
Posts: 692
Karma: 2180740
Join Date: Jan 2017
Location: Poland
Device: Misc
|
I confirm, that works!
Code:
set QT_QPA_PLATFORM=windows:altgr |
09-10-2021, 12:14 PM | #69 |
Sigil Developer
Posts: 7,654
Karma: 5433388
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. |
09-10-2021, 12:21 PM | #70 | ||
Grand Sorcerer
Posts: 27,552
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
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. |
||
09-10-2021, 12:28 PM | #71 | |
Grand Sorcerer
Posts: 27,552
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
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. Last edited by DiapDealer; 09-10-2021 at 12:30 PM. |
|
09-10-2021, 12:40 PM | #72 |
Sigil Developer
Posts: 7,654
Karma: 5433388
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. |
09-10-2021, 12:48 PM | #73 | |
Grand Sorcerer
Posts: 27,552
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
|
|
09-10-2021, 01:11 PM | #74 |
Sigil Developer
Posts: 7,654
Karma: 5433388
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. |
09-10-2021, 07:08 PM | #75 |
Grand Sorcerer
Posts: 27,552
Karma: 193191846
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"); I don't want to play around with ifdefing for Windows and creating new preference settings if it's not going to work. |
|
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 |