Skip to content

Commit 9b6fbeb

Browse files
authored
lua: use virtual key events (ExpressLRS#191)
This fixes the non-working movent on the X9D+ Signed-off-by: Stefan Naewe <[email protected]>
1 parent 2026785 commit 9b6fbeb

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

src/lua/ExLRS.lua

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -301,9 +301,7 @@ local function run_func(event)
301301
end
302302

303303
-- now process key events
304-
if event == EVT_ROT_LEFT or
305-
event == EVT_PLUS_BREAK or
306-
event == EVT_DOWN_BREAK then
304+
if event == EVT_VIRTUAL_NEXT then
307305
if selection.state == false then
308306
decrease(selection)
309307
crossfireTelemetryPush(0x2D, {0xEE, 0xEA, 0x00, 0x00})
@@ -326,9 +324,7 @@ local function run_func(event)
326324
pushed = true
327325
end
328326
end
329-
elseif event == EVT_ROT_RIGHT or
330-
event == EVT_MINUS_BREAK or
331-
event == EVT_UP_BREAK then
327+
elseif event == EVT_VIRTUAL_PREV then
332328
if selection.state == false then
333329
increase(selection)
334330
crossfireTelemetryPush(0x2D, {0xEE, 0xEA, 0x00, 0x00})
@@ -351,10 +347,10 @@ local function run_func(event)
351347
pushed = true
352348
end
353349
end
354-
elseif event == EVT_ENTER_BREAK then
350+
elseif event == EVT_VIRTUAL_ENTER then
355351
selection.state = not selection.state
356352

357-
elseif event == EVT_EXIT_BREAK and selection.state then
353+
elseif event == EVT_VIRTUAL_EXIT and selection.state then
358354
-- I was hoping to find the T16 RTN button as an alternate way of deselecting
359355
-- a field, but no luck so far
360356
selection.state = false

0 commit comments

Comments
 (0)