AEFeinstein / Super-2024-Swadge-FW

Firmware for the Super Magfest 2024 Swadge
https://adam.feinste.in/Super-2024-Swadge-FW/
MIT License
10 stars 9 forks source link

Pretty Keyboard #240

Open johnnywycliffe opened 1 month ago

johnnywycliffe commented 1 month ago

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() call textEntryStartPretty() 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 Screenshot 2024-06-28 150209

AEFeinstein commented 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(...);
}
johnnywycliffe commented 1 month ago

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,

AEFeinstein commented 1 month ago

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!

johnnywycliffe commented 1 month ago

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.