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

Method getPressedFrontButton

src/MappedInputManager.cpp:118–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116}
117
118int MappedInputManager::getPressedFrontButton() const {
119 // Scan the raw front buttons in hardware order.
120 // This bypasses remapping so the remap activity can capture physical presses.
121 if (gpio.wasPressed(HalGPIO::BTN_BACK)) {
122 return HalGPIO::BTN_BACK;
123 }
124 if (gpio.wasPressed(HalGPIO::BTN_CONFIRM)) {
125 return HalGPIO::BTN_CONFIRM;
126 }
127 if (gpio.wasPressed(HalGPIO::BTN_LEFT)) {
128 return HalGPIO::BTN_LEFT;
129 }
130 if (gpio.wasPressed(HalGPIO::BTN_RIGHT)) {
131 return HalGPIO::BTN_RIGHT;
132 }
133 return -1;
134}

Callers 1

loopMethod · 0.80

Calls 1

wasPressedMethod · 0.45

Tested by

no test coverage detected