Fix the Radiomaster

This commit is contained in:
Jonathan Bennett 2025-06-07 21:54:34 -05:00
parent 6302fa0753
commit f47c789081
2 changed files with 11 additions and 11 deletions

View File

@ -146,31 +146,31 @@ void ExpressLRSFiveWay::determineAction(KeyType key, PressLength length)
{ {
switch (key) { switch (key) {
case LEFT: case LEFT:
if (inCannedMessageMenu()) // If in canned message menu if (inCannedMessageMenu()) // If in canned message menu
sendKey(CANCEL); // exit the menu (press imaginary cancel key) sendKey(INPUT_BROKER_CANCEL); // exit the menu (press imaginary cancel key)
else else
sendKey(LEFT); sendKey(INPUT_BROKER_LEFT);
break; break;
case RIGHT: case RIGHT:
if (inCannedMessageMenu()) // If in canned message menu: if (inCannedMessageMenu()) // If in canned message menu:
sendKey(CANCEL); // exit the menu (press imaginary cancel key) sendKey(INPUT_BROKER_CANCEL); // exit the menu (press imaginary cancel key)
else else
sendKey(RIGHT); sendKey(INPUT_BROKER_RIGHT);
break; break;
case UP: case UP:
if (length == LONG) if (length == LONG)
toggleGPS(); toggleGPS();
else else
sendKey(UP); sendKey(INPUT_BROKER_UP);
break; break;
case DOWN: case DOWN:
if (length == LONG) if (length == LONG)
sendAdhocPing(); sendAdhocPing();
else else
sendKey(DOWN); sendKey(INPUT_BROKER_DOWN);
break; break;
case OK: case OK:
@ -186,7 +186,7 @@ void ExpressLRSFiveWay::determineAction(KeyType key, PressLength length)
} }
// Feed input to the canned messages module // Feed input to the canned messages module
void ExpressLRSFiveWay::sendKey(KeyType key) void ExpressLRSFiveWay::sendKey(input_broker_event key)
{ {
InputEvent e; InputEvent e;
e.source = inputSourceName; e.source = inputSourceName;
@ -251,7 +251,7 @@ void ExpressLRSFiveWay::click()
if (!moduleConfig.canned_message.enabled) if (!moduleConfig.canned_message.enabled)
powerFSM.trigger(EVENT_PRESS); powerFSM.trigger(EVENT_PRESS);
else else
sendKey(OK); sendKey(INPUT_BROKER_SELECT);
} }
ExpressLRSFiveWay *expressLRSFiveWayInput = nullptr; ExpressLRSFiveWay *expressLRSFiveWayInput = nullptr;

View File

@ -63,7 +63,7 @@ class ExpressLRSFiveWay : public Observable<const InputEvent *>, public concurre
// Meshtastic code // Meshtastic code
void determineAction(KeyType key, PressLength length); void determineAction(KeyType key, PressLength length);
void sendKey(KeyType key); void sendKey(input_broker_event key);
inline bool inCannedMessageMenu() { return cannedMessageModule->shouldDraw(); } inline bool inCannedMessageMenu() { return cannedMessageModule->shouldDraw(); }
int32_t runOnce() override; int32_t runOnce() override;