Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 09-15-2021, 08:11 PM   #121
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: 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?
KevinH is offline   Reply With Quote
Old 09-15-2021, 08:39 PM   #122
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
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"   '`'
"Ctrl + Shift + 6" works and in Shortcut field is grabbed "Ctrl + Shift + 6". When I press "Ctrl + Shift + 0" (or Ctrl + =), nothing appears in the Shortcut field, nothing is grabbed and, consecuently, the shortcut doesn't work. Finally, when I press "Ctrl + Shift + ^", in the Shortcut field is grabbed "Ctrl + Shift + some weird chars (two)". The shortcut doesn't work.

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:
The result with the combinations of Ctrl + Shift are the same as the result with the AltGr disabled. But I also tested combinations with AltGr.
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 + #")
RbnJrg is offline   Reply With Quote
Advert
Old 09-15-2021, 09:02 PM   #123
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: 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.
KevinH is offline   Reply With Quote
Old 09-16-2021, 03:06 AM   #124
BeckyEbook
Guru
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: 692
Karma: 2180740
Join Date: Jan 2017
Location: Poland
Device: Misc
Quote:
Originally Posted by KevinH View Post
How should Diacritics (dead keys) be treated. Should/can they be used alone in a keyboard shortcut?
Dead keys should be blocked from being assigned to a keyboard shortcut as that would take away their sense of being in the keyboard layout.
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:
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?
Yes. I think there are relatively simple keyboard layouts in Windows (e.g. Polish programmer or German) and those that are very complex, where AltGr is used to type complex diacritics. I've never dealt with them, but it's safer to assume that it's better not to use these shortcuts that have a "special effect" on your keyboard layout. I will repeat again – it does not make sense, because if we used such an abbreviation, we would take the possibility of inserting diacritics from our language (native or not) in the Code View or the Find & Replace window.

Quote:
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.
I am for Case A, although in the case of "shifted" and only "shifted" I am able to accept Case B.

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+!.
BeckyEbook is offline   Reply With Quote
Old 09-16-2021, 09:12 AM   #125
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,542
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by BeckyEbook View Post
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),
To me, any of both options are acceptable, meanwhile works

Quote:
* I don't like Ctrl+Shift+!.
Yes, that's ugly and it doesn't reflect the reality.
RbnJrg is offline   Reply With Quote
Advert
Old 09-16-2021, 09:35 AM   #126
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: 7,645
Karma: 5433388
Join Date: Nov 2009
Device: many
Quote:
* I don't like Ctrl+Shift+!.
Yes, that's ugly and it doesn't reflect the reality.
And does not work, which is how we got started on this whole thing to begin with.

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.
KevinH is offline   Reply With Quote
Old 09-16-2021, 10:19 AM   #127
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: 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
KevinH is offline   Reply With Quote
Old 09-16-2021, 12:43 PM   #128
BeckyEbook
Guru
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: 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.
BeckyEbook is offline   Reply With Quote
Old 09-16-2021, 12:50 PM   #129
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: 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?
DiapDealer is offline   Reply With Quote
Old 09-16-2021, 01:08 PM   #130
BeckyEbook
Guru
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: 692
Karma: 2180740
Join Date: Jan 2017
Location: Poland
Device: Misc
Quote:
Originally Posted by DiapDealer View Post
I'm able to create, save, but happily not use, single-key alphanumeric shortcuts. Was this always the case before?
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).
BeckyEbook is offline   Reply With Quote
Old 09-16-2021, 01:14 PM   #131
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: 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.
DiapDealer is offline   Reply With Quote
Old 09-16-2021, 05:49 PM   #132
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,575
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by DiapDealer View Post
I'm able to create, save, but happily not use, single-key alphanumeric shortcuts. Was this always the case before?
Yes, Sigil's always been thus - I discovered it accidentally years ago.

BR
BetterRed is offline   Reply With Quote
Old 09-17-2021, 09:52 AM   #133
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: 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.
KevinH is offline   Reply With Quote
Old 09-17-2021, 12:08 PM   #134
BeckyEbook
Guru
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: 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.
BeckyEbook is offline   Reply With Quote
Old 09-17-2021, 12:34 PM   #135
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: 27,552
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by BeckyEbook View Post
This is cool because I assigned the "S" key to "Add Semantic" and the shortcut works when I'm in Book Browser.
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.
DiapDealer is offline   Reply With Quote
Reply


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 10:58 PM.


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