mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-13 16:42:07 +00:00
Fix the Radiomaster
This commit is contained in:
parent
6302fa0753
commit
f47c789081
@ -146,31 +146,31 @@ void ExpressLRSFiveWay::determineAction(KeyType key, PressLength length)
|
||||
{
|
||||
switch (key) {
|
||||
case LEFT:
|
||||
if (inCannedMessageMenu()) // If in canned message menu
|
||||
sendKey(CANCEL); // exit the menu (press imaginary cancel key)
|
||||
if (inCannedMessageMenu()) // If in canned message menu
|
||||
sendKey(INPUT_BROKER_CANCEL); // exit the menu (press imaginary cancel key)
|
||||
else
|
||||
sendKey(LEFT);
|
||||
sendKey(INPUT_BROKER_LEFT);
|
||||
break;
|
||||
|
||||
case RIGHT:
|
||||
if (inCannedMessageMenu()) // If in canned message menu:
|
||||
sendKey(CANCEL); // exit the menu (press imaginary cancel key)
|
||||
if (inCannedMessageMenu()) // If in canned message menu:
|
||||
sendKey(INPUT_BROKER_CANCEL); // exit the menu (press imaginary cancel key)
|
||||
else
|
||||
sendKey(RIGHT);
|
||||
sendKey(INPUT_BROKER_RIGHT);
|
||||
break;
|
||||
|
||||
case UP:
|
||||
if (length == LONG)
|
||||
toggleGPS();
|
||||
else
|
||||
sendKey(UP);
|
||||
sendKey(INPUT_BROKER_UP);
|
||||
break;
|
||||
|
||||
case DOWN:
|
||||
if (length == LONG)
|
||||
sendAdhocPing();
|
||||
else
|
||||
sendKey(DOWN);
|
||||
sendKey(INPUT_BROKER_DOWN);
|
||||
break;
|
||||
|
||||
case OK:
|
||||
@ -186,7 +186,7 @@ void ExpressLRSFiveWay::determineAction(KeyType key, PressLength length)
|
||||
}
|
||||
|
||||
// Feed input to the canned messages module
|
||||
void ExpressLRSFiveWay::sendKey(KeyType key)
|
||||
void ExpressLRSFiveWay::sendKey(input_broker_event key)
|
||||
{
|
||||
InputEvent e;
|
||||
e.source = inputSourceName;
|
||||
@ -251,7 +251,7 @@ void ExpressLRSFiveWay::click()
|
||||
if (!moduleConfig.canned_message.enabled)
|
||||
powerFSM.trigger(EVENT_PRESS);
|
||||
else
|
||||
sendKey(OK);
|
||||
sendKey(INPUT_BROKER_SELECT);
|
||||
}
|
||||
|
||||
ExpressLRSFiveWay *expressLRSFiveWayInput = nullptr;
|
||||
|
@ -63,7 +63,7 @@ class ExpressLRSFiveWay : public Observable<const InputEvent *>, public concurre
|
||||
|
||||
// Meshtastic code
|
||||
void determineAction(KeyType key, PressLength length);
|
||||
void sendKey(KeyType key);
|
||||
void sendKey(input_broker_event key);
|
||||
inline bool inCannedMessageMenu() { return cannedMessageModule->shouldDraw(); }
|
||||
int32_t runOnce() override;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user