![]() |
#31 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,341
Karma: 203719646
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? |
![]() |
![]() |
![]() |
#32 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,439
Karma: 5703082
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. |
![]() |
![]() |
Advert | |
|
![]() |
#33 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,341
Karma: 203719646
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. |
![]() |
![]() |
![]() |
#34 | |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,439
Karma: 5703082
Join Date: Nov 2009
Device: many
|
Yes!
Quote:
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. |
|
![]() |
![]() |
![]() |
#35 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,439
Karma: 5703082
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. |
![]() |
![]() |
Advert | |
|
![]() |
#36 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,439
Karma: 5703082
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. |
![]() |
![]() |
![]() |
#37 |
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 515
Karma: 2268308
Join Date: Nov 2015
Device: none
|
Some keyboards have lowercase letters in the Shift register.
|
![]() |
![]() |
![]() |
#38 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,439
Karma: 5703082
Join Date: Nov 2009
Device: many
|
|
![]() |
![]() |
![]() |
#39 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,341
Karma: 203719646
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
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. |
|
![]() |
![]() |
![]() |
#40 | |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,439
Karma: 5703082
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:
|
|
![]() |
![]() |
![]() |
#41 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,341
Karma: 203719646
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.
|
![]() |
![]() |
![]() |
#42 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,439
Karma: 5703082
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. |
![]() |
![]() |
![]() |
#43 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,341
Karma: 203719646
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Sounds like plan!
|
![]() |
![]() |
![]() |
#44 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 808
Karma: 2416112
Join Date: Jan 2017
Location: Poland
Device: Various
|
@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 |
![]() |
![]() |
![]() |
#45 | |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,439
Karma: 5703082
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:
|
|
![]() |
![]() |
![]() |
|
![]() |
||||
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 |