MCPcopy Create free account
hub / github.com/crosspoint-reader/crosspoint-reader / loop

Method loop

src/activities/util/IntervalSelectionActivity.cpp:28–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26}
27
28void IntervalSelectionActivity::loop() {
29 if (ignoreConfirmRelease) {
30 if (mappedInput.wasReleased(MappedInputManager::Button::Confirm)) {
31 ignoreConfirmRelease = false;
32 return;
33 }
34 if (!mappedInput.isPressed(MappedInputManager::Button::Confirm)) {
35 ignoreConfirmRelease = false;
36 }
37 }
38
39 if (mappedInput.wasReleased(MappedInputManager::Button::Back)) {
40 ActivityResult result;
41 result.isCancelled = true;
42 setResult(std::move(result));
43 finish();
44 return;
45 }
46
47 if (mappedInput.wasReleased(MappedInputManager::Button::Confirm)) {
48 setResult(IntervalResult{static_cast<uint32_t>(value)});
49 finish();
50 return;
51 }
52
53 buttonNavigator.onPressAndContinuous({MappedInputManager::Button::Left}, [this] { adjustValue(-smallStep); });
54 buttonNavigator.onPressAndContinuous({MappedInputManager::Button::Right}, [this] { adjustValue(smallStep); });
55 buttonNavigator.onPressAndContinuous({MappedInputManager::Button::Up}, [this] { adjustValue(largeStep); });
56 buttonNavigator.onPressAndContinuous({MappedInputManager::Button::Down}, [this] { adjustValue(-largeStep); });
57}
58
59void IntervalSelectionActivity::render(RenderLock&&) {
60 renderer.clearScreen();

Callers

nothing calls this directly

Calls 3

onPressAndContinuousMethod · 0.80
wasReleasedMethod · 0.45
isPressedMethod · 0.45

Tested by

no test coverage detected