Open johnnywycliffe opened 1 month ago
Snazzy! This keyboard was originally written for an SSD1306 monochrome display, so I'm glad it's getting a fresh coat of paint!
One thing to note is that the cursor blink is way off. textEntryDraw()
should take elapsedUs
as an argument and run an accurate timer like:
bool cursorIsShowing = false;
...
// Flip cursorIsShowing every quarter second (250000 uS)
cursorTimer += elapsedUs;
while(cursorTimer >= 250000)
{
cursorTimer -= 250000;
cursorIsShowing = !cursorIsShowing;
}
if(cursorIsShowing)
{
drawLineFast(...);
}
I haven't touched the blinking yet lol. I noticed that the end function for the keyboard literally does nothing despite having a comment "Disarms the cursor blink" so I figure that was broken a while ago.
I can look into it,
Yeah... I bet it was used in one mode and worked there, so that was that. I'm all for incidentally making it suck less!
Added a few new features:
Note:
Blinking might be a bit sporadic, I think it's my test program, but TextEntryInput()
seems to be blocking.
Summary The current keyboard is white text on a black background. It should be prettier.
Technical Spec A simple added background with some boxes to keep the text visible on screen. Colors can be set for the shadowboxes and text. Drop in replacement for the old keyboard to not break compatibility.
Usage Instead of calling
textEntryStart()
calltextEntryStartPretty()
with the following arguments:Otherwise, use textEntryDraw() and textEntryInput() as before.
How to test In the PrettyKeeb branch: Run ./swadge_emulator.exe -m Keyboard Test
Edit background, text color, and shadowbox color in main/modes/test/keebTest/keebTest.c
Example