mirror of
https://github.com/opentx/opentx.git
synced 2025-07-26 01:35:21 +03:00
Added X-Lite support to CROSSFIRE Lua
This commit is contained in:
parent
14a96e17be
commit
80c2bc7242
2 changed files with 8 additions and 8 deletions
|
@ -87,9 +87,9 @@ local function run(event)
|
||||||
return 2
|
return 2
|
||||||
elseif event == EVT_EXIT_BREAK then
|
elseif event == EVT_EXIT_BREAK then
|
||||||
return 2
|
return 2
|
||||||
elseif event == EVT_ROT_LEFT then
|
elseif event == EVT_ROT_LEFT or event == EVT_DOWN_BREAK then
|
||||||
selectDevice(1)
|
selectDevice(1)
|
||||||
elseif event == EVT_ROT_RIGHT then
|
elseif event == EVT_ROT_RIGHT or event == EVT_UP_BREAK then
|
||||||
selectDevice(-1)
|
selectDevice(-1)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ local function run(event)
|
||||||
else
|
else
|
||||||
for i=1, #devices do
|
for i=1, #devices do
|
||||||
local attr = (lineIndex == i and INVERS or 0)
|
local attr = (lineIndex == i and INVERS or 0)
|
||||||
if event == EVT_ROT_BREAK and attr == INVERS then
|
if (event == EVT_ROT_BREAK or event == EVT_RIGHT_BREAK) and attr == INVERS then
|
||||||
crossfireTelemetryPush(0x28, { devices[i].id, 0xEA })
|
crossfireTelemetryPush(0x28, { devices[i].id, 0xEA })
|
||||||
return "device.lua"
|
return "device.lua"
|
||||||
end
|
end
|
||||||
|
|
|
@ -430,7 +430,7 @@ local function runDevicePage(event)
|
||||||
else
|
else
|
||||||
return "crossfire.lua"
|
return "crossfire.lua"
|
||||||
end
|
end
|
||||||
elseif event == EVT_ROT_BREAK then -- toggle editing/selecting current field
|
elseif event == EVT_ROT_BREAK or event == EVT_RIGHT_BREAK then -- toggle editing/selecting current field
|
||||||
local field = getField(lineIndex)
|
local field = getField(lineIndex)
|
||||||
if field.name then
|
if field.name then
|
||||||
if field.type == 10 then
|
if field.type == 10 then
|
||||||
|
@ -451,15 +451,15 @@ local function runDevicePage(event)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif edit then
|
elseif edit then
|
||||||
if event == EVT_ROT_RIGHT then
|
if event == EVT_ROT_RIGHT or event == EVT_DOWN_BREAK then
|
||||||
incrField(1)
|
incrField(1)
|
||||||
elseif event == EVT_ROT_LEFT then
|
elseif event == EVT_ROT_LEFT or event == EVT_UP_BREAK then
|
||||||
incrField(-1)
|
incrField(-1)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if event == EVT_ROT_RIGHT then
|
if event == EVT_ROT_RIGHT or event == EVT_DOWN_BREAK then
|
||||||
selectField(1)
|
selectField(1)
|
||||||
elseif event == EVT_ROT_LEFT then
|
elseif event == EVT_ROT_LEFT or event == EVT_UP_BREAK then
|
||||||
selectField(-1)
|
selectField(-1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue