Skip to content

Commit 52eb392

Browse files
authored
Fix: reverse lua buttons (ExpressLRS#129)
* reverse lua buttons
1 parent 71b24d8 commit 52eb392

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/lua/ExLRS.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,16 @@ local function getFlags(element)
7575
end
7676

7777
local function increase(data)
78-
if data.selected < data.elements then
79-
data.selected = data.selected + 1
78+
if data.selected > 1 then
79+
data.selected = data.selected - 1
8080
--playTone(2000, 50, 0)
8181
end
8282
-- if data.selected > data.elements then data.selected = 1 end
8383
end
8484

8585
local function decrease(data)
86-
if data.selected > 1 then
87-
data.selected = data.selected - 1
86+
if data.selected < data.elements then
87+
data.selected = data.selected + 1
8888
--playTone(2000, 50, 0)
8989
end
9090
-- if data.selected < 1 then data.selected = data.elements end
@@ -287,7 +287,7 @@ local function run_func(event)
287287

288288
-- now process key events
289289
if event == EVT_ROT_LEFT or
290-
event == EVT_MINUS_BREAK or
290+
event == EVT_PLUS_BREAK or
291291
event == EVT_DOWN_BREAK then
292292
if selection.state == false then
293293
decrease(selection)
@@ -312,7 +312,7 @@ local function run_func(event)
312312
end
313313
end
314314
elseif event == EVT_ROT_RIGHT or
315-
event == EVT_PLUS_BREAK or
315+
event == EVT_MINUS_BREAK or
316316
event == EVT_UP_BREAK then
317317
if selection.state == false then
318318
increase(selection)

0 commit comments

Comments
 (0)