09-09-2021, 02:50 PM | #46 |
Sigil Developer
Posts: 7,647
Karma: 5433388
Join Date: Nov 2009
Device: many
|
We can change things to ifdef that Windows routine and convert the nativeVirtualKeyCode on Windows if that is what Windows users want.
I personally expect when entering Meta+Shift+1 to see Meta+! and ditto for Alt, as a result because Shift+1 is the ! character and that is how it typically worked on MacOS and Linux. But I am open to either since I am not a Windows user and as long as we do not need to change the Sigil link command to include a new library. |
09-09-2021, 02:59 PM | #47 | ||
Guru
Posts: 692
Karma: 2180740
Join Date: Jan 2017
Location: Poland
Device: Misc
|
Quote:
I just don't like the shortcut shown, but obviously it's more important to get it right than display the shortcut. Fiels = Input "Shortcut" in Preferences > Keyboard Shortcuts. Quote:
The entry itself in the table. But when I think about it, the entry in the table is not crucial, because correct operation is more important. So let's admit that it's better, although it is worth having other people testing it with international keyboards. |
||
Advert | |
|
09-09-2021, 03:13 PM | #48 |
Guru
Posts: 692
Karma: 2180740
Join Date: Jan 2017
Location: Poland
Device: Misc
|
But there is one thing that works worse.
Well – if you remember – in Windows, users using international keyboards should add the -platform windows:altgr parameter, which allows, for example, to easily call even the default keyboard shortcuts for Clips. Sigil 1.7.0 (with parameter) nicely distinguishes left Alt and right Alt, and unfortunately the latest build displays garbage for right Alt+letter. |
09-09-2021, 03:20 PM | #49 |
Sigil Developer
Posts: 7,647
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Hmm okay. Does your version using the Windows call to map the nativeVirtualKeyCode to its char work properly with -platform windows:altgr
If so that is a strong argument to go with your added Windows call approach. Or did we mess that up with an earlier change to master? |
09-09-2021, 03:41 PM | #50 |
Grand Sorcerer
Posts: 27,552
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
If all we're doing is removing the Shift on Windows when the Shift is unnecessary (and problematic), I can't see how that would affect the display of a Right Alt+letter sequence on an International Keyboard. I'm confused.
|
Advert | |
|
09-09-2021, 03:56 PM | #51 |
Grand Sorcerer
Posts: 27,552
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
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.
|
09-09-2021, 04:02 PM | #52 | |
Guru
Posts: 692
Karma: 2180740
Join Date: Jan 2017
Location: Poland
Device: Misc
|
Quote:
And now, when in the Keyboard Shortcuts window I select the AltGr+; then I get garbage. But I note that this only happens when starting Sigil with the parameter. Again, I suspect this is such an extremely rare situation for another Windows user to encounter this problem that I wonder if it is worth wasting your precious time on it. It would have to be: a) Windows user who b) uses the international keyboard and obtains additional characters using AltGr c) runs Sigil with an additional parameter d) would have the crazy idea to use a shortcut with AltGr if he can use the left Alt for this and then everything works fine. |
|
09-09-2021, 04:08 PM | #53 |
Grand Sorcerer
Posts: 27,552
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I'm not opposed to looking into it, I'm just completely in the dark on there being an altgr platform plugin parameter in the first place.
|
09-09-2021, 04:09 PM | #54 | |
Guru
Posts: 692
Karma: 2180740
Join Date: Jan 2017
Location: Poland
Device: Misc
|
Quote:
We talked about it here: https://github.com/Sigil-Ebook/Sigil/issues/474 the parameter was mentioned e.g. here: https://bugreports.qt.io/browse/QTBU...comment-504202 https://bugreports.qt.io/browse/QTBU...comment-416209 is also in Sigil's documentation: https://github.com/Sigil-Ebook/sigil...faq.xhtml#L228 |
|
09-09-2021, 04:44 PM | #55 |
Sigil Developer
Posts: 7,647
Karma: 5433388
Join Date: Nov 2009
Device: many
|
One other difference, in the calibre way we simply remove the shift modifier and leave all other modifiers alone, but in the old way, we started with 0 and or'd in just the flags we wanted to use. So if there is an altgr flag mapped to a GroupModifier it got lost in the old way. Perhaps that is what we need to do under calibre's approach as well?
Also the two approaches treat number (digits) chars differently based on text() values. Last edited by KevinH; 09-09-2021 at 06:17 PM. |
09-10-2021, 08:14 AM | #56 |
Sigil Developer
Posts: 7,647
Karma: 5433388
Join Date: Nov 2009
Device: many
|
@BeckyEbook, I will need help tracking down what got broken with the altgr command line switch being enabled in order to fix it.
What does the debug output say when using it? How does the list of modifiers (value of state) differ between when a normal alt is done vs an altgr? Or are the modifiers unchanged and it just changes the key() or text() value to reflect the fact that altgr us being used? |
09-10-2021, 08:59 AM | #57 |
Guru
Posts: 692
Karma: 2180740
Join Date: Jan 2017
Location: Poland
Device: Misc
|
Debug.
The order of my shortcuts:
Issue (garbage visible in "Shortcut" input box) occurs only when the parameter is enabled and only when using the shortcut from AltGr. The other shortcuts appear identical. |
09-10-2021, 09:20 AM | #58 |
Sigil Developer
Posts: 7,647
Karma: 5433388
Join Date: Nov 2009
Device: many
|
If you get a chance can you copy the qdebug and add it to the working Sigil 1.7.0 version, use the altgr command line with it and run the exact same tests and post its output as well.
That way can see what changes if anything between working and non-working versions when altgr is added to the command line. At first glance, adding altgr to command line changed the modifier flags from both Ctrl+Alt used to GroupModifier used which seems to match the qt docs but KeyboardShortcuts.cpp handleKey never even looks or adds in the GroupModifier so I am unsure how that worked at all! |
09-10-2021, 09:49 AM | #59 |
Guru
Posts: 692
Karma: 2180740
Join Date: Jan 2017
Location: Poland
Device: Misc
|
QDebug added to 1.7.0.
|
09-10-2021, 09:55 AM | #60 |
Sigil Developer
Posts: 7,647
Karma: 5433388
Join Date: Nov 2009
Device: many
|
I searched the Qt 5.12 codebase for GroupSwitchModifier and it is not used in QKeySequence at all (qtbase/src/gui/kernel/qkeysequence.cpp). In fact it appears to not be supported in much code at all.
In Sigil 1.7 in KeyboardShortcutsWidget.cpp we build up the resulting modifier by checking modifier flags but do not handle the GroupSwitchModifier at all so it gets stripped out but the actual key() value reflects its use with altgr in the command line. In current master, the key() with altgr in the command line does reflect its use but the GroupSwitchModifier is kept. And that seems to confuse QKeySequence since it does not grok the GroupSwitchModifier at all. I will try in master or Windows checking for the GroupModifier and if set remove it before trying calibre's approach in the hopes everything just works. |
|
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 |