Fix displayed characters #16
Merged
MicheleC
merged 4 commits from fix/key-display
into master
3 years ago
Loading…
Reference in new issue
There is no content yet.
Delete Branch 'fix/key-display'
Deleting a branch is permanent. It CANNOT be undone. Continue?
Blank the key for the VoidSymbol, .notdef, character which is usually an upright outline rectangle.
For example, Turkish keyboard, AltGr+'D'.
Add combining character for key display.
Toggle the case of the displayed AltGr alpha characters when Caps is on.
For example on the Italian keyboard, the sequence AltGr+ Caps+AltGr+ AltGr+Shift+ Caps+AltGr+Shift+ on the 'D' key prints as ðÐÐð.
Pre-patch this shows on the kvkbd key as ððÐÐ, and post-patch shows as printed.
VoidSymbol: need to discuss whether it is right or wrong.
caps+altGr text: PR is good but need some rework to align to the rest of the code (will result in more performing code)
{
if (shift)
{
TQPushButton::setText(altGrShiftText.lower());
@Ray-V
Could you rework the code so that it is similar to the other cases? What I mean is to introduce two variables (for example capsAltGrText and capsAltGrShiftText) and set them in setupTexts() and here we just call setText() with the corresponding variable?
The difference is setupText() is called much less frequently that shiftCapsAltGrPressed(), so we avoid continuous lower()/upper() calls and related memory usage.
I suggest we add a function setAltGrText() similar to the way we use setShiftText().
{ 0x0000fe65L, 0x1ffe }, /* dead_abovereversedcomma ῾ Greek Dasia */
{ 0x0000fe68L, 0x02cd }, /* dead_belowmacron ˍ modifier letter low macron, eg actual=ṯ */
{ 0x0000fe6eL, 0x201a }, /* dead_belowcomma ‚ quotesinglbase, eg actual=ț */
{ 0x00ffffffL, 0x0020 }, /* VoidSymbol -> <- space */
Not sure what is the best here. VoidSymbol is supposed to be void, right? I understand the point that the empty rectangle character may look ugly, but inserting a blank (0x20) is different from inserting a void symbol.
I can't think of a real useful usage of a void symbol to be honest, but it seems wrong to me to replace it with a blank. @SlavekB what is your opinion on this as well?
This is ok, as per this commnet
I'll see what I can do. I did look at something similar, but didn't consider resource usage and decided it was overkill for what was needed.
I think that one of the benefits of kvkbd is that it shows on the keys what characters will be printed - an advantage over a physical keyboard for the level 3 & 4 characters where the user has to know what character will be printed by any particular key sequence.
The .notdef character is ugly and it also detracts from the display of the characters which any set of modifier keys enable.
This in no way affects the functioning of either type of keyboard, so it's not a replacement, it's just a representation on the kvkbd key. It seems reasonable to me that if a key prints nothing, it should show nothing.
Oh yes 🤦 I totally forgot about that and thought about the character being printed and not shown on the key. In that case, I agree with you!
5f2cc19f6d
to907f3d61aa
3 years agoHi @Ray-V,
this had been pending for a while. I have rebased and adjusted the code as I had previously asked. Could you test everything is fine on your side before we proceed with merging?
Works for me
f519fe9ea2
into master 3 years agoThanks for testing and for the original PR work @Ray-V.
Reviewers
f519fe9ea2
.