09-15-2021, 08:11 PM | #121 |
Sigil Developer
Posts: 7,645
Karma: 5433388
Join Date: Nov 2009
Device: many
|
How should Diacritics (dead keys) be treated. Should/can they be used alone in a keyboard shortcut?
|
09-15-2021, 08:39 PM | #122 |
Wizard
Posts: 1,542
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Well, these are the logs from my tests on the last Sigil beta:
With AltGr disabled: Code:
Warning: Unable to open default EUDC font: "EUDC.TTE" Debug: regenerating tag list Debug: key(): "94" '^' Debug: text(): "\u001E" Debug: nativeVirtualKey(): 54 Debug: letter: "^" Debug: modifiers: QFlags<Qt::KeyboardModifier>(ShiftModifier|ControlModifier) Debug: MapVK_VK_TO_CHAR: "54" '6' Debug: Debug: key(): "94" '^' Debug: text(): "" Debug: nativeVirtualKey(): 186 Debug: letter: "^" Debug: modifiers: QFlags<Qt::KeyboardModifier>(ShiftModifier|ControlModifier) Debug: MapVK_VK_TO_CHAR: "2147483744" '`' With the AltGr enabled, this is the log: Code:
Warning: Unable to open default EUDC font: "EUDC.TTE" Debug: regenerating tag list Debug: key(): "94" '^' Debug: text(): "\u001E" Debug: nativeVirtualKey(): 54 Debug: letter: "^" Debug: modifiers: QFlags<Qt::KeyboardModifier>(ShiftModifier|ControlModifier) Debug: MapVK_VK_TO_CHAR: "54" '6' Debug: Debug: key(): "94" '^' Debug: text(): "" Debug: nativeVirtualKey(): 186 Debug: letter: "^" Debug: modifiers: QFlags<Qt::KeyboardModifier>(ShiftModifier|ControlModifier) Debug: MapVK_VK_TO_CHAR: "2147483744" '`' Debug: Debug: key(): "124" '|' Debug: text(): "|" Debug: nativeVirtualKey(): 49 Debug: letter: "|" Debug: modifiers: QFlags<Qt::KeyboardModifier>(GroupSwitchModifier) Debug: MapVK_VK_TO_CHAR: "49" '1' Debug: Debug: key(): "64" '@' Debug: text(): "@" Debug: nativeVirtualKey(): 50 Debug: letter: "@" Debug: modifiers: QFlags<Qt::KeyboardModifier>(GroupSwitchModifier) Debug: MapVK_VK_TO_CHAR: "50" '2' Debug: Debug: key(): "35" '#' Debug: text(): "#" Debug: nativeVirtualKey(): 51 Debug: letter: "#" Debug: modifiers: QFlags<Qt::KeyboardModifier>(GroupSwitchModifier) Debug: MapVK_VK_TO_CHAR: "51" '3' Debug: When I pressed AltGr + 1, in the Shortcut field appeared "1" (it should appear "|"). Of course, the shortcut didn't work. In the previous beta, in the Shortcut field was grabbed "|" (it should grab "Ctrl + Alt + |") and also didn't work. The same things happened when I pressed "Alt + 2" and "Alt + 3"; in the Shortcut field was grabbed "2" and "3" respectively (instead of "@" and "#", or the correct shortcut "Ctrl + Alt + @" and "Ctrl + Alt + #") |
Advert | |
|
09-15-2021, 09:02 PM | #123 |
Sigil Developer
Posts: 7,645
Karma: 5433388
Join Date: Nov 2009
Device: many
|
So your Ctrl+Shift+6 now works
Your Ctrl+Shift+0 is being captured by your operating system for something (Zoom in or increase the volume or something) and that is why it never reaches Qt and Sigil. Your Ctrl+Shift+` is a dead key (diacritic) which should create the ^. Dead keys are a known problem that we are working on. I am not sure how to treat them since they should be followed by another key to form a compound character. And unless I am confused, I think BeckyEbook just explained that AltGr should really not be used in Shortcuts since it is used to form a character. With AltGR enabled it frees up Ctrl+Alt sequences to create more shortcuts since they are no longer being mapped to AltGr. BeckyEbook is that correct? The next issue is more basic: Case A: Should a Shortcut sequence only include the sequence of keys actually hit as defined only by the main/primary symbol on that key? Or Case B: Should a Shortcut sequence include the impact of the modifiers (Control,Shift, Alt, etc) being used and map the primary key to its secondary (shifted, etc) definition and use that in the key sequence. It can be argued either way. I am not sure one is more right than another. On macOS, Case A is most often used. I am not sure about other platforms. But Qt seems to want to use Case B, but then we have to almost guess to see if the Shift key was needed to create that character and if so to remove the shift from the key sequence so it can actually be used. Thank you for testing and reporting back! Let's wait to see what others think. Last edited by KevinH; 09-15-2021 at 09:48 PM. |
09-16-2021, 03:06 AM | #124 | |||
Guru
Posts: 692
Karma: 2180740
Join Date: Jan 2017
Location: Poland
Device: Misc
|
Quote:
This is not a huge requirement and the conscious user should not even think about using a dead key to define a hotkey in any application. IMHO developers should not be held responsible for all user behavior. By the way – in the keyboard shortcut definition window, you can define "ordinary" letters, for example A or B and such shortcuts, although they will be saved, they will not work (and luckily). Quote:
Quote:
On my keyboard layout, where Shift+1=!: * I prefer the notation Ctrl+Shift+1, * I could understand Ctrl+! (since I can see an exclamation mark, I know I have to press Shift), * I don't like Ctrl+Shift+!. |
|||
09-16-2021, 09:12 AM | #125 | ||
Wizard
Posts: 1,542
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
Quote:
|
||
Advert | |
|
09-16-2021, 09:35 AM | #126 | |
Sigil Developer
Posts: 7,645
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Quote:
So I am going to modify the Windows code one more time to do the following: - if GroupSwitchModifier is set, ignore the key sequence and return - if MapVk... returns with the high bit set identifying it as a dead key, ignore the key sequence and just return. I will push those changes for people to try. |
|
09-16-2021, 10:19 AM | #127 |
Sigil Developer
Posts: 7,645
Karma: 5433388
Join Date: Nov 2009
Device: many
|
@BeckyEbook,
When you get a free moment, please build from master and let me know what you think. If Enable AltGr is set, the new code should prevent any key sequence which uses AltGr from being generated. If the MapVk... call indicates a dead key was going to be used in the sequence it will output debug info but return, preventing that key sequence from being generated. This should prevent users from doing things that they probably shouldn't and prevent garbage chars and stuff from being written to screen or to the ini file. Thanks |
09-16-2021, 12:43 PM | #128 |
Guru
Posts: 692
Karma: 2180740
Join Date: Jan 2017
Location: Poland
Device: Misc
|
I confirm: it is great!
Locked AltGr shortcuts (which wouldn't make sense anyway) and dead keys. |
09-16-2021, 12:50 PM | #129 |
Grand Sorcerer
Posts: 27,552
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I'm able to create, save, but happily not use, single-key alphanumeric shortcuts. Was this always the case before?
|
09-16-2021, 01:08 PM | #130 |
Guru
Posts: 692
Karma: 2180740
Join Date: Jan 2017
Location: Poland
Device: Misc
|
I suppose so. I checked on version 1.30 and the behavior is the same (you can assign a keyboard shortcut, but a single-letter one will not work anyway).
|
09-16-2021, 01:14 PM | #131 |
Grand Sorcerer
Posts: 27,552
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Thanks for checking. I just don't use the feature enough to know the particulars of how it behaved before the recent changes.
|
09-16-2021, 05:49 PM | #132 |
null operator (he/him)
Posts: 20,575
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
|
09-17-2021, 09:52 AM | #133 |
Sigil Developer
Posts: 7,645
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Okay, I think we may have solved this bug with what is in master yesterday. I spent some time looking at the Qt plugin source code in qtbase for Windows. It uses a ToUnicode() Windows call in their code and comments there indicate this call returns the wrong key for situations when Ctrl is used on some keyboard layouts, which explains RbnJrg's broken Ctrl+Shift+6 bug result.
Since Qt's internal code is broken here (according to their own comments) as well as various attempts at failed fixes according to github, the only correct way I can see is to use the MapVirtualKeyW(vk, MAPVK_VK_TO_CHAR) approach and use Case A (which is what is in master). So unless there are issues with other platforms, I will consider this one fixed. Thanks for all who tested and helped! Last edited by KevinH; 09-17-2021 at 09:57 AM. |
09-17-2021, 12:08 PM | #134 |
Guru
Posts: 692
Karma: 2180740
Join Date: Jan 2017
Location: Poland
Device: Misc
|
@DiapDealer, @BetterRed: I need to correct my last information about single-key alphanumeric keyboard shortcuts.
Single-key shortcuts work, but only when the focus is not in the Code View or some edit field. So they work when we have active other panels: Book Browser, Preview, Clips, or Table of Contents. This is cool because I assigned the "S" key to "Add Semantic" and the shortcut works when I'm in Book Browser. |
09-17-2021, 12:34 PM | #135 |
Grand Sorcerer
Posts: 27,552
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Good to know. I had to check to make sure it wouldn't interfere with a Book Browser file rename, but it doesn't. Qt seems to know to ignore any such requests when there's a text-input widget active.
|
|
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 |