jf-roku/components/config/ConfigScene.brs
Neil Burrows 6d757653da Linter: Consistent IF statement format
No parentheses.  Use THEN if it's a one line statement.  Don't use THEN if it's a block statement
2021-06-26 14:52:16 +01:00

28 lines
728 B
Plaintext

sub init()
m.top.setFocus(true)
m.top.optionsAvailable = false
end sub
function onKeyEvent(key as String, press as Boolean) as Boolean
' Returns true if user navigates to a new focusable element
if not press then return false
list = m.top.findNode("configOptions")
button = m.top.findNode("submit")
if key = "back"
m.top.backPressed = true
else if key = "down" and button.focusedChild = invalid
limit = list.content.getChildren(-1, 0).count() - 1
if limit = list.itemFocused
m.top.setFocus(false)
button.setFocus(true)
return true
end if
else if key = "up" and button.focusedChild <> invalid
list.setFocus(true)
return true
end if
return false
end function