Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slightly prettier virtual keyboard #4776

Merged
merged 5 commits into from Mar 12, 2019

Conversation

Projects
None yet
3 participants
@NiLuJe
Copy link
Member

commented Mar 12, 2019

Square keys with a thin border, and changed the flash from an invert to a temporary thick inner border, as discussed on Gitter (àla Kindle).

Depends on koreader/koreader-base#846

@NiLuJe

This comment has been minimized.

Copy link
Member Author

commented Mar 12, 2019

Did not manage to make the disappearing key phenomenon any better, though.
Just confirmed that it is indeed left to the mercy of the kernel/eInk controller.

On the plus side, the design change gets rid of the small glitchy corners that sometimes happened since the targeted repaint changes.

As for the "flash", it has the added benefit of not touching the glyph's background, which means the fb content doesn't change, which in turns means the A2+FORCE_MONOCHROME update doesn't stomp on the glyph's AA ;).

@NiLuJe

This comment has been minimized.

Copy link
Member Author

commented Mar 12, 2019

Obligatory screenshot ;).

vkeyb

@NiLuJe

This comment has been minimized.

Copy link
Member Author

commented Mar 12, 2019

Hmm, moving to a refresh of the full board on key release yields slightly different behavior:

Instead of disappearing keys, you (potentially, when spamming) have larger shreds of keyboard disappearing, but only temporarily (I did not manage to get stuck with bits of invisible stuff).
It's potentially more distracting, and probably tanks the reactivity a tiny bit more, so, leaving this here for science/discussion...

diff --git a/frontend/ui/widget/virtualkeyboard.lua b/frontend/ui/widget/virtualkeyboard.lua
index 6cc173a2..02a7a8c0 100644
--- a/frontend/ui/widget/virtualkeyboard.lua
+++ b/frontend/ui/widget/virtualkeyboard.lua
@@ -137,10 +137,17 @@ function VirtualKey:update_keyboard(want_flash, want_fast)
         end
         -- Only repaint the key itself, not the full board...
         UIManager:widgetRepaint(self[1], self[1].dimen.x, self[1].dimen.y)
-        UIManager:setDirty(nil, function()
-            logger.dbg("update key region", self[1].dimen)
-            return refresh_type, self[1].dimen
-        end)
+        -- Refresh the full board on key release, to alleviate the disappearing key syndrom...
+        if want_fast then
+            UIManager:setDirty(nil, function()
+                logger.dbg("update key region", self[1].dimen)
+                return refresh_type, self[1].dimen
+            end)
+        else
+            UIManager:setDirty(self.keyboard, function()
+                return refresh_type, self.keyboard[1][1].dimen
+            end)
+        end
     end
 end
@avsej

This comment has been minimized.

Copy link
Contributor

commented Mar 12, 2019

Cool stuff, I think once merged, it could close #4590

@Frenzie

This comment has been minimized.

Copy link
Member

commented Mar 12, 2019

@NiLuJe

It's potentially more distracting, and probably tanks the reactivity a tiny bit more, so, leaving this here for science/discussion...

I haven't tested it, but iirc the keyboard used to do something along those lines for a while and it was awful. (Unresponsive missing keypresses awful, as opposed to the current aesthetically somewhat displeasing but otherwise okay.)

@NiLuJe

This comment has been minimized.

Copy link
Member Author

commented Mar 12, 2019

@Frenzie: Yeah, I remember the good old "tearing" thread ^^.

To be fair, that (the inlined diff) doesn't appear to affect reactivity too much... except when it really gets heavily glitchy, the "catching up" behavior makes it feel a little bit rubber-bandy...

@Frenzie Frenzie added the UX label Mar 12, 2019

@Frenzie Frenzie added this to the 2019.04 milestone Mar 12, 2019

Bump base
Pickup paintInnerBorder
@NiLuJe

This comment has been minimized.

Copy link
Member Author

commented Mar 12, 2019

Hmm, yeah, I think the current behavior is the least annoying.

I could only mostly really get rid of eInk shenanigans by delaying the callback a lot (500ms), and the unhighlight a bit (150ms), and that wasn't particularly fun to use.

Also, managed to find out many new weird things about how broken A2 is on Kobo :D.
(I was testing setting the fb @ UR yesterday, which exacerbated the behavior. Confirmed with outside testing that it's wonderfully broken, so, I'll be fixing that for KSM users ;)).

With the less broken rotation, I mostly get skipped unhilights instead of disappearing keys, which more closely matches the native keyboard.
I also definitely get the kernel shouting "many collisions, handle it!" at me :D.

@Frenzie Frenzie merged commit 930286d into koreader:master Mar 12, 2019

1 check failed

ci/circleci Your tests failed on CircleCI
Details
@Frenzie

This comment has been minimized.

Copy link
Member

commented Mar 12, 2019

Darn Framagit. :-)

@NiLuJe

This comment has been minimized.

Copy link
Member Author

commented Mar 12, 2019

Thanks for the xref @avsej, I'd forgotten that we had a FR open about it ;).

@NiLuJe NiLuJe referenced this pull request Mar 15, 2019

Open

One big lump #4806

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.