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-08-2021, 07:42 PM   #31
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,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I should have some time coming up to test what you guys are cooking up on both virtual and physical Linux and Windows machines. Just let me know what's needed.

Do we need to consider a cross-platform utility class/function that we can easily call from anywhere, or is it something that will probably be OK with a bit of well-placed MainWindow ifdef-ing?
DiapDealer is online now   Reply With Quote
Old 09-08-2021, 09:00 PM   #32
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,644
Karma: 5433388
Join Date: Nov 2009
Device: many
It all depends. I would love to create a utility routine to create a table of keycode, shift used, and nativeVirtualKeyCode (basically a quick and dirty keyboard mapping of base and shifted keys).

This would work crossplatform. I just do not know how the nativeVirtualKeyCode is determined or how to create a map given those values are only provided inside a QKeyEvent and we can not force people to hit each key once with and without shift just to build a table each time Sigil is started.

Perhaps let's just focus on getting Windows fixed as macOS seems to function okay with the current code for the most part.
KevinH is offline   Reply With Quote
Advert
Old 09-08-2021, 11:18 PM   #33
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,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Anything helpful or relevant here?

https://github.com/kovidgoyal/calibr...eyboard.py#L33

https://github.com/kovidgoyal/calibr...rtcuts.py#L109

Last edited by DiapDealer; 09-08-2021 at 11:34 PM.
DiapDealer is online now   Reply With Quote
Old 09-09-2021, 10:28 AM   #34
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,644
Karma: 5433388
Join Date: Nov 2009
Device: many
Yes!
Quote:
Originally Posted by DiapDealer View Post
Kovid is handling knowing if a shift is needed or not by checking if the key when uppercased == the key when lowercased. That should be true for all numbers and punctuation and all special symbols.

It is very similar to the code we use - ours uses unicode character classes - to accomplish something close.

Let's give Kovid's way a try to see how that works.

Excellent! I have my fingers crossed.
KevinH is offline   Reply With Quote
Old 09-09-2021, 10:54 AM   #35
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,644
Karma: 5433388
Join Date: Nov 2009
Device: many
Nope! That code is very broken on macOS. It removes the Shift from the sequence Ctrl+Shift+1 since all digits have no upper or lower and so meet the criteria for removing the SHIFT.

Perhaps it will help Windows. I will try that next.
KevinH is offline   Reply With Quote
Advert
Old 09-09-2021, 11:09 AM   #36
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,644
Karma: 5433388
Join Date: Nov 2009
Device: many
Okay, I have ifdef'd calibre's approach for use on Windows only. I pushed it to master with some additional debug output and used [deploy] in the commit message.

Would you give it a try and let me know if that works any better than what we have on Windows?

Please try a bunch of code sequences including Ctrl+Shift+1, Alt+Shift+1 and without the shift.
KevinH is offline   Reply With Quote
Old 09-09-2021, 11:15 AM   #37
Sarmat89
Evangelist
Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.
 
Posts: 482
Karma: 2267928
Join Date: Nov 2015
Device: none
Some keyboards have lowercase letters in the Shift register.
Sarmat89 is offline   Reply With Quote
Old 09-09-2021, 11:29 AM   #38
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,644
Karma: 5433388
Join Date: Nov 2009
Device: many
Quote:
Originally Posted by Sarmat89 View Post
Some keyboards have lowercase letters in the Shift register.
Understood but they should work fine in the Windows test since they differ between upper and lower case.
KevinH is offline   Reply With Quote
Old 09-09-2021, 11:47 AM   #39
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,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by KevinH View Post
Okay, I have ifdef'd calibre's approach for use on Windows only. I pushed it to master with some additional debug output and used [deploy] in the commit message.

Would you give it a try and let me know if that works any better than what we have on Windows?

Please try a bunch of code sequences including Ctrl+Shift+1, Alt+Shift+1 and without the shift.
That seems to working with everything I've thrown it so far (on an English standard Windows keyboard).

Ctrl+Shift+1 results in a working Ctrl+! shortcut (displayed and saved).
Ctrl+Alt+1 results in a working Ctrl+Alt+1 shortcut (displayed and saved).
Alt+Shift+1 results in a working Alt+! shortcut (displayed and saved).
Alt+Shift+G results in Alt+Shift+G that works
Ctrl+Shift+9 results in Ctrl+(
Alt+Ctrl+9 results in Alt+Ctrl+9

All seem to work and are stored/restored from the .ini in working order.

I've tried lots more than that, but nothing seems to messing up that I know of. I'm not a much of a shortcut user, though, so I might have missed something.

Last edited by DiapDealer; 09-09-2021 at 11:50 AM.
DiapDealer is online now   Reply With Quote
Old 09-09-2021, 12:08 PM   #40
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,644
Karma: 5433388
Join Date: Nov 2009
Device: many
Wonderful!

@BeckyEbook would you please try current master on your International keyboard and see if it shows the correct mappings too.

@DiapDelaer - when you get a free moment can you test things are still fully working on Linux as well. Linux still uses our original code so let's hope it just works.

Thanks!

Quote:
Originally Posted by DiapDealer View Post
That seems to working with everything I've thrown it so far (on an English standard Windows keyboard).

Ctrl+Shift+1 results in a working Ctrl+! shortcut (displayed and saved).
Ctrl+Alt+1 results in a working Ctrl+Alt+1 shortcut (displayed and saved).
Alt+Shift+1 results in a working Alt+! shortcut (displayed and saved).
Alt+Shift+G results in Alt+Shift+G that works
Ctrl+Shift+9 results in Ctrl+(
Alt+Ctrl+9 results in Alt+Ctrl+9

All seem to work and are stored/restored from the .ini in working order.

I've tried lots more than that, but nothing seems to messing up that I know of. I'm not a much of a shortcut user, though, so I might have missed something.
KevinH is offline   Reply With Quote
Old 09-09-2021, 12:15 PM   #41
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,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I'll have to wait until I get home to try on Linux. It _should_ work, since it did before. My only worry is that it might only be on newer versions of Qt on Linux that it "just works". But if I get a chance, I'll try to check it out on some older Qts using some Linux VMs.
DiapDealer is online now   Reply With Quote
Old 09-09-2021, 12:29 PM   #42
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,644
Karma: 5433388
Join Date: Nov 2009
Device: many
Great!

BTW, I have been able to use a variant of calibre's approach and an ifdef to macOS to handle the macOS broken case of Meta+Shift+! (and @#$ etc) to properly make it Meta+! as it should be.

So hopefully we will have all platforms working better than they were before.
KevinH is offline   Reply With Quote
Old 09-09-2021, 12:48 PM   #43
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,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Sounds like plan!
DiapDealer is online now   Reply With Quote
Old 09-09-2021, 01:58 PM   #44
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
@KevinH:

I built a new Sigil and I have mixed feelings.

1. I don't like (no offense) the way Calibre does this. For me, Ctrl+Shift+1 is Ctrl+Shift+1, not Ctrl+!
2. In the current master version, Shift is omitted, so I can see Ctrl+! or after pressing Alt+Shift+2 I can see Alt+@
3. When in the field with the shortcut I put a Polish (and probably also a different one) diacritic, I see some unreadable double-byte sequence of characters.

I would suggest looking at another solution that shows the shortcuts in a more friendly way.

That's why I checked out two other GPL 3.0 projects on Github and maybe this code will help:

https://github.com/hluk/CopyQ/blob/6...tform.cpp#L263

https://github.com/QYQYMBA/ChiyaProj...indow.cpp#L148

In these applications, the Windows keyboard shortcuts display values Ctrl+Shift+1 (not Ctrl+!).

Becky
BeckyEbook is offline   Reply With Quote
Old 09-09-2021, 02:42 PM   #45
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,644
Karma: 5433388
Join Date: Nov 2009
Device: many
The first link you sent is the simplest and it appears to use the Windows only approach you mentioned earlier.

But I am confused ... did calibre's code work correctly and you just did not "like" the Shortcut shown, or did it actually fail with some key sequences and that is why you did not "like" the Shortcut shown?

And what do you mean by "when in the field with the shortcut"?

Do you mean the "Ctrl+!" output shown? If so, that is not meant to be an input field to be edited. Entering other keys there will create issues. For example the del key or backspace will erase the key sequence completely. It is not meant for editing directly but to display the key sequence entered.

Or do you mean the table entry itself or when editing the ini?




Quote:
Originally Posted by BeckyEbook View Post
@KevinH:

I built a new Sigil and I have mixed feelings.

1. I don't like (no offense) the way Calibre does this. For me, Ctrl+Shift+1 is Ctrl+Shift+1, not Ctrl+!
2. In the current master version, Shift is omitted, so I can see Ctrl+! or after pressing Alt+Shift+2 I can see Alt+@
3. When in the field with the shortcut I put a Polish (and probably also a different one) diacritic, I see some unreadable double-byte sequence of characters.

I would suggest looking at another solution that shows the shortcuts in a more friendly way.

That's why I checked out two other GPL 3.0 projects on Github and maybe this code will help:

https://github.com/hluk/CopyQ/blob/6...tform.cpp#L263

https://github.com/QYQYMBA/ChiyaProj...indow.cpp#L148

In these applications, the Windows keyboard shortcuts display values Ctrl+Shift+1 (not Ctrl+!).

Becky
KevinH 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 06:26 AM.


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