diff --git a/src/graphics/tftSetup.cpp b/src/graphics/tftSetup.cpp index 1d42dddf28..a4b7c3ff58 100644 --- a/src/graphics/tftSetup.cpp +++ b/src/graphics/tftSetup.cpp @@ -342,25 +342,25 @@ bool muiDisplayInfo(uint16_t &width, uint16_t &height, bool &hasTouch) return width > 0 && height > 0; } -// The broker's LEFT/RIGHT codes are swapped relative to LVGL's, hence the cross-map below. +// Broker and LVGL key codes disagree (LEFT/RIGHT are swapped), so map by name. bool muiInjectInputEvent(uint32_t eventCode, uint32_t kbChar, uint32_t touchX, uint32_t touchY) { if (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR) return false; - // trackball semantics: vertical is encoder rotation (moves group focus), horizontal the slider keys + // arrows go in as D-pad keys; device-ui's input policy decides focus traversal per context switch (eventCode) { case INPUT_BROKER_UP: - DisplayMirror::injectEncoder(-1); + DisplayMirror::injectKey(LV_KEY_UP); break; case INPUT_BROKER_DOWN: - DisplayMirror::injectEncoder(1); - break; - case INPUT_BROKER_LEFT: DisplayMirror::injectKey(LV_KEY_DOWN); break; + case INPUT_BROKER_LEFT: + DisplayMirror::injectKey(LV_KEY_LEFT); + break; case INPUT_BROKER_RIGHT: - DisplayMirror::injectKey(LV_KEY_UP); + DisplayMirror::injectKey(LV_KEY_RIGHT); break; case INPUT_BROKER_SELECT: // with coordinates this is a touch long-press, as the physical touch driver emits it diff --git a/variants/native/portduino/platformio.ini b/variants/native/portduino/platformio.ini index 269d27b061..c175669c36 100644 --- a/variants/native/portduino/platformio.ini +++ b/variants/native/portduino/platformio.ini @@ -89,7 +89,7 @@ extends = env:native-tft board_level = extra lib_deps = ${native_base.lib_deps} - https://github.com/jamesarich/device-ui/archive/0b20b01333d42b32af8cc95c63034ac3c70a50ca.zip + https://github.com/jamesarich/device-ui/archive/0996862d2ffb1bdef6748cce76491868404481e8.zip build_flags = ${env:native-tft.build_flags} -D MESHTASTIC_MUI_MIRROR=1