mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-30 14:40:40 +00:00
Merge branch 'master' into detsensor_broadcast_changes
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];
|
||||
|
||||
@@ -114,6 +114,7 @@ class CannedMessageModule : public SinglePortModule, public Observable<const UIF
|
||||
virtual bool wantUIFrame() override { return this->shouldDraw(); }
|
||||
virtual Observable<const UIFrameEvent *> *getUIFrameObservable() override { return this; }
|
||||
virtual void drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) override;
|
||||
virtual bool interceptingKeyboardInput() override;
|
||||
virtual AdminMessageHandleResult handleAdminMessageForModule(const meshtastic_MeshPacket &mp,
|
||||
meshtastic_AdminMessage *request,
|
||||
meshtastic_AdminMessage *response) override;
|
||||
|
||||
Reference in New Issue
Block a user