From 7bcb8f1fee51ee100c4883350d85a24ce406a692 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Wed, 22 May 2024 07:54:06 -0500 Subject: [PATCH] Portduino: Catch the keyboard power button and initiate poweroff (#3953) --- src/input/LinuxInput.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/input/LinuxInput.cpp b/src/input/LinuxInput.cpp index 1ace2044c..6194195ed 100644 --- a/src/input/LinuxInput.cpp +++ b/src/input/LinuxInput.cpp @@ -155,6 +155,9 @@ int32_t LinuxInput::runOnce() case KEY_ENTER: // Enter e.inputEvent = meshtastic_ModuleConfig_CannedMessageConfig_InputEventChar_SELECT; break; + case KEY_POWER: + system("poweroff"); + break; default: // all other keys if (keymap[code]) { e.inputEvent = ANYKEY;