From a8b838bd47e14dde9c44e41e4f850ccd7703a488 Mon Sep 17 00:00:00 2001 From: Federico Amedeo Izzo Date: Thu, 8 Jul 2021 20:24:27 +0200 Subject: [PATCH] On Linux target emulate PTT button with P key --- platform/targets/linux/platform.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/platform/targets/linux/platform.c b/platform/targets/linux/platform.c index 353d2997..b0fdbb56 100644 --- a/platform/targets/linux/platform.c +++ b/platform/targets/linux/platform.c @@ -19,6 +19,7 @@ #include #include #include "emulator.h" +#include hwInfo_t hwInfo; @@ -76,7 +77,13 @@ int8_t platform_getChSelector() bool platform_getPttStatus() { - return Radio_State.PttStatus; + // Read P key status from SDL + SDL_PumpEvents(); + const uint8_t *state = SDL_GetKeyboardState(NULL); + if (state[SDL_SCANCODE_P]) + return true; + else + return false; } bool platform_pwrButtonStatus()