diff --git a/src/configuration.h b/src/configuration.h index ec32c72d1..c3dd2cb06 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -161,6 +161,14 @@ along with this program. If not, see . also enable HAS_ option not specifically disabled by variant.h */ #include "architecture.h" +#ifndef DEFAULT_REBOOT_SECONDS +#define DEFAULT_REBOOT_SECONDS 7 +#endif + +#ifndef DEFAULT_SHUTDOWN_SECONDS +#define DEFAULT_SHUTDOWN_SECONDS 2 +#endif + /* Step #3: mop up with disabled values for HAS_ options not handled by the above two */ // ----------------------------------------------------------------------------- diff --git a/src/input/kbI2cBase.cpp b/src/input/kbI2cBase.cpp index 1dba4e34d..048f8bbdc 100644 --- a/src/input/kbI2cBase.cpp +++ b/src/input/kbI2cBase.cpp @@ -216,6 +216,12 @@ int32_t KbI2cBase::runOnce() e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_RIGHT; e.kbchar = 0xb7; break; + case 0x90: // fn+r + case 0x9b: // fn+s + // just pass those unmodified + e.inputEvent = ANYKEY; + e.kbchar = c; + break; case 0x0d: // Enter e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_SELECT; break; diff --git a/src/modules/AdminModule.cpp b/src/modules/AdminModule.cpp index ae0dac9ff..c44048fd2 100644 --- a/src/modules/AdminModule.cpp +++ b/src/modules/AdminModule.cpp @@ -20,8 +20,6 @@ #include "mqtt/MQTT.h" -#define DEFAULT_REBOOT_SECONDS 7 - AdminModule *adminModule; bool hasOpenEditTransaction; diff --git a/src/modules/CannedMessageModule.cpp b/src/modules/CannedMessageModule.cpp index 3293e5d0d..60334ca03 100644 --- a/src/modules/CannedMessageModule.cpp +++ b/src/modules/CannedMessageModule.cpp @@ -409,6 +409,16 @@ int32_t CannedMessageModule::runOnce() case 0xb7: // right // already handled above break; + // handle fn+s for shutdown + case 0x9b: + screen->startShutdownScreen(); + shutdownAtMsec = millis() + DEFAULT_SHUTDOWN_SECONDS * 1000; + break; + // and fn+r for reboot + case 0x90: + screen->startRebootScreen(); + rebootAtMsec = millis() + DEFAULT_REBOOT_SECONDS * 1000; + break; default: if (this->cursor == this->freetext.length()) { this->freetext += this->payload;