mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-04 14:47:37 +03:00
ref: simplify confirm held for caps logic
This commit is contained in:
parent
1a34af2c87
commit
4462bfd5ef
@ -226,13 +226,12 @@ void KeyboardEntryActivity::loop() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Selection
|
// Selection
|
||||||
if (mappedInput.isPressed(MappedInputManager::Button::Confirm) && mappedInput.getHeldTime() >= capsMs) {
|
if (mappedInput.wasPressed(MappedInputManager::Button::Confirm)) {
|
||||||
onCapsHeld();
|
if (mappedInput.getHeldTime() >= capsMs) {
|
||||||
return;
|
shiftActive = !shiftActive;
|
||||||
}
|
} else {
|
||||||
|
handleKeyPress();
|
||||||
if (mappedInput.wasPressed(MappedInputManager::Button::Confirm) && mappedInput.getHeldTime() < capsMs) {
|
}
|
||||||
handleKeyPress();
|
|
||||||
updateRequired = true;
|
updateRequired = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -358,13 +357,3 @@ void KeyboardEntryActivity::renderItemWithSelector(const int x, const int y, con
|
|||||||
}
|
}
|
||||||
renderer.drawText(UI_10_FONT_ID, x, y, item);
|
renderer.drawText(UI_10_FONT_ID, x, y, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
void KeyboardEntryActivity::onCapsHeld() {
|
|
||||||
waitForCapsRelease();
|
|
||||||
shiftActive = !shiftActive;
|
|
||||||
updateRequired = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void KeyboardEntryActivity::waitForCapsRelease() {
|
|
||||||
while (mappedInput.isPressed(MappedInputManager::Button::Confirm)) delay(50);
|
|
||||||
}
|
|
||||||
|
|||||||
@ -96,7 +96,4 @@ class KeyboardEntryActivity : public Activity {
|
|||||||
int getRowLength(int row) const;
|
int getRowLength(int row) const;
|
||||||
void render() const;
|
void render() const;
|
||||||
void renderItemWithSelector(int x, int y, const char* item, bool isSelected) const;
|
void renderItemWithSelector(int x, int y, const char* item, bool isSelected) const;
|
||||||
|
|
||||||
void onCapsHeld();
|
|
||||||
void waitForCapsRelease();
|
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user