mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-20 17:52:35 +00:00
Wrangle module frames with I2C keyboard (#4817)
* Only suppress UI nav if module using keyboard input * CardKB combo to dismiss text message and waypoint Currently assigned to Fn + Delete
This commit is contained in:
@@ -276,6 +276,13 @@ int CannedMessageModule::handleInputEvent(const InputEvent *event)
|
||||
showTemporaryMessage("Node Info \nUpdate Sent");
|
||||
}
|
||||
break;
|
||||
case INPUT_BROKER_MSG_DISMISS_FRAME: // fn+del: dismiss screen frames like text or waypoint
|
||||
// Avoid opening the canned message screen frame
|
||||
// We're only handling the keypress here by convention, this has nothing to do with canned messages
|
||||
this->runState = CANNED_MESSAGE_RUN_STATE_INACTIVE;
|
||||
// Attempt to close whatever frame is currently shown on display
|
||||
screen->dismissCurrentFrame();
|
||||
return 0;
|
||||
default:
|
||||
// pass the pressed key
|
||||
// LOG_DEBUG("Canned message ANYKEY (%x)\n", event->kbchar);
|
||||
@@ -935,6 +942,19 @@ void CannedMessageModule::drawEnterIcon(OLEDDisplay *display, int x, int y, floa
|
||||
|
||||
#endif
|
||||
|
||||
// Indicate to screen class that module is handling keyboard input specially (at certain times)
|
||||
// This prevents the left & right keys being used for nav. between screen frames during text entry.
|
||||
bool CannedMessageModule::interceptingKeyboardInput()
|
||||
{
|
||||
switch (runState) {
|
||||
case CANNED_MESSAGE_RUN_STATE_DISABLED:
|
||||
case CANNED_MESSAGE_RUN_STATE_INACTIVE:
|
||||
return false;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
void CannedMessageModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
|
||||
{
|
||||
char buffer[50];
|
||||
|
||||
Reference in New Issue
Block a user