Compare commits

...

4 Commits

Author SHA1 Message Date
Justin
cd1d498cd2
Merge 4462bfd5ef into e5c0ddc9fa 2026-02-01 13:45:43 +01:00
Justin Luque
4462bfd5ef
ref: simplify confirm held for caps logic 2026-01-19 12:38:22 -05:00
Justin Luque
1a34af2c87
fix: set update required on toggling switchActive
From what I can tell, this is necessary to render the upper (or lower) case alphabet immediately
2026-01-15 20:07:39 -05:00
Justin Luque
3937e949bf
feat: hold confirm/select for caps 2026-01-15 19:15:16 -05:00

View File

@ -13,6 +13,10 @@ const char* const KeyboardEntryActivity::keyboard[NUM_ROWS] = {
const char* const KeyboardEntryActivity::keyboardShift[NUM_ROWS] = {"~!@#$%^&*()_+", "QWERTYUIOP{}|", "ASDFGHJKL:\"",
"ZXCVBNM<>?", "SPECIAL ROW"};
namespace {
constexpr unsigned long capsMs = 1000;
}
void KeyboardEntryActivity::taskTrampoline(void* param) {
auto* self = static_cast<KeyboardEntryActivity*>(param);
self->displayTaskLoop();
@ -94,6 +98,7 @@ void KeyboardEntryActivity::handleKeyPress() {
if (selectedCol >= SHIFT_COL && selectedCol < SPACE_COL) {
// Shift toggle
shiftActive = !shiftActive;
updateRequired = true;
return;
}
@ -234,7 +239,11 @@ void KeyboardEntryActivity::loop() {
// Selection
if (mappedInput.wasPressed(MappedInputManager::Button::Confirm)) {
handleKeyPress();
if (mappedInput.getHeldTime() >= capsMs) {
shiftActive = !shiftActive;
} else {
handleKeyPress();
}
updateRequired = true;
}