On Linux target emulate PTT button with P key

replace/4e14121555e9a6f4e8c68ae50c081f30c9356273
Federico Amedeo Izzo 2021-07-08 20:24:27 +02:00
rodzic fdd50c114c
commit a8b838bd47
1 zmienionych plików z 8 dodań i 1 usunięć

Wyświetl plik

@ -19,6 +19,7 @@
#include <interfaces/gpio.h>
#include <stdio.h>
#include "emulator.h"
#include <SDL2/SDL.h>
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()