mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-04 14:47:37 +03:00
Merge 4462bfd5ef into d403044f76
This commit is contained in:
commit
97a5332713
@ -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)) {
|
||||||
|
if (mappedInput.getHeldTime() >= capsMs) {
|
||||||
|
shiftActive = !shiftActive;
|
||||||
|
} else {
|
||||||
handleKeyPress();
|
handleKeyPress();
|
||||||
|
}
|
||||||
updateRequired = true;
|
updateRequired = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user