jf-roku/components/config/ConfigScene.brs

28 lines
728 B
Plaintext
Raw Normal View History

2019-03-14 17:11:51 +00:00
sub init()
m.top.setFocus(true)
m.top.optionsAvailable = false
2019-03-14 17:11:51 +00:00
end sub
function onKeyEvent(key as String, press as Boolean) as Boolean
2019-04-29 19:10:02 +00:00
' Returns true if user navigates to a new focusable element
2019-03-14 17:11:51 +00:00
if not press then return false
2019-10-13 19:33:14 +00:00
2019-03-14 17:11:51 +00:00
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
2019-03-14 17:11:51 +00:00
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