On Linux target emulate PTT button with P key
This commit is contained in:
parent
fdd50c114c
commit
a8b838bd47
|
|
@ -19,6 +19,7 @@
|
||||||
#include <interfaces/gpio.h>
|
#include <interfaces/gpio.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "emulator.h"
|
#include "emulator.h"
|
||||||
|
#include <SDL2/SDL.h>
|
||||||
|
|
||||||
hwInfo_t hwInfo;
|
hwInfo_t hwInfo;
|
||||||
|
|
||||||
|
|
@ -76,7 +77,13 @@ int8_t platform_getChSelector()
|
||||||
|
|
||||||
bool platform_getPttStatus()
|
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()
|
bool platform_pwrButtonStatus()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue