Compare commits

...

4 Commits

Author SHA1 Message Date
Justin
13bfbbaefb
Merge 4462bfd5ef into 4848a77e1b 2026-01-27 22:02:36 +08: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:\"", const char* const KeyboardEntryActivity::keyboardShift[NUM_ROWS] = {"~!@#$%^&*()_+", "QWERTYUIOP{}|", "ASDFGHJKL:\"",
"ZXCVBNM<>?", "SPECIAL ROW"}; "ZXCVBNM<>?", "SPECIAL ROW"};
namespace {
constexpr unsigned long capsMs = 1000;
}
void KeyboardEntryActivity::taskTrampoline(void* param) { void KeyboardEntryActivity::taskTrampoline(void* param) {
auto* self = static_cast<KeyboardEntryActivity*>(param); auto* self = static_cast<KeyboardEntryActivity*>(param);
self->displayTaskLoop(); self->displayTaskLoop();
@ -94,6 +98,7 @@ void KeyboardEntryActivity::handleKeyPress() {
if (selectedCol >= SHIFT_COL && selectedCol < SPACE_COL) { if (selectedCol >= SHIFT_COL && selectedCol < SPACE_COL) {
// Shift toggle // Shift toggle
shiftActive = !shiftActive; shiftActive = !shiftActive;
updateRequired = true;
return; return;
} }
@ -234,7 +239,11 @@ void KeyboardEntryActivity::loop() {
// Selection // Selection
if (mappedInput.wasPressed(MappedInputManager::Button::Confirm)) { if (mappedInput.wasPressed(MappedInputManager::Button::Confirm)) {
handleKeyPress(); if (mappedInput.getHeldTime() >= capsMs) {
shiftActive = !shiftActive;
} else {
handleKeyPress();
}
updateRequired = true; updateRequired = true;
} }