Hi guys! First post. Anyways, I’ve got a real head-scratcher with this one. I am making a basic Roku app at the moment with a menu, and I have a few options on the screen that are position on top of each other - a TextEditBox and a couple Button objects. When you press “up” or “down” you can swap between these options. This works… except for when I press “down” from the first option. I have a basic debugger that will show me if certain parts of the code execute, and it shows that navigation works fine EXCEPT for when I press “down” while the focus is on the first option in the menu. The conditional statement doesn’t even get executed while the focus is on the first element, but I can tell that the TV is getting the signal from the remote (little light flashes on the TV). This has been driving me kind of nuts haha
Anyways, here is the code of the if statements that handle the “up” and “down” onKeyEvents (it’s super explicitly typed, but this is so that I don’t have to worry about issues lying elsewhere):
if key = "down"
m.debugger.text = "down"
if m.selectedIndex = 0
m.firstButton.setFocus(true)
m.selectedIndex = 1
else if m.selectedIndex = 1
m.secondButton.setFocus(true)
m.selectedIndex = 2
else if m.selectedIndex = 2
m.textBox.setFocus(true)
m.selectedIndex = 0
end if
else if key = "up"
m.debugger.text = "up"
if m.selectedIndex = 0
m.firstButton.setFocus(true)
m.selectedIndex = 2
else if m.selectedIndex = 2
m.secondButton.setFocus(true)
m.selectedIndex = 1
else if m.selectedIndex = 1
m.textBox.setFocus(true)
m.selectedIndex = 0
end if
end if
Like I said, when the index is at 0 and the focus is on the textBox, the debugger I have doesn’t show “down” like it should and the only thing that happens is that whatever is typed into the text box disappears, but then comes back if I navigate all the way around back to the text box. But “up” always works, and “down” works when I am on the first or second buttons (indexes 1 and 2, respectively). Thank you in advance for your help ![]()
