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" `onKeyEvent`s (it's super explicitly typed, but this is so that I don't have to worry about issues lying elsewhere):
```
Ok, I figured out the problem (still don't understand the "why" though...). Putting focus on a `TextEditBox` and then trying to put the focus on a `Button` just wasn't working. I had to replace the `TextEditBox` with a `Button` and now the navigation works completely as expected. Still don't really know why this was a problem, but at least it works now.
Also, as a side note, to kind of simulate that the text box had focus I just put the button behind it and set it's `visible` property to "false". However, this did NOT work. So, for those of you with the same issue, I replaced the label I had for the text box with the button, so that the label is focusable and brings up the keyboard/pinpad when the label button is pressed.
Roku app development is somethin else...
Happy coding!
The TextEditBox likely has its own OnKeyEvent and its returning true for that keypress and keeping it. You just look upstream from where you are into anything that extends from it. Since the keypress trickles down the very top object can return true on that keypress and swallow it. If it returns false you can also have scripts further down the chain react to that same keypress.
That is why it doesn't work as you expected to get the keypress to pass you must return false in your OnKeyEvent handler for that keypress to have it move down to the next script and so on.
Hope you understand. If you do not let us know.
Because your button label thing you mention where you simulate focus of the text edit box has me thinking you do not understand. Mainly because that is so wrong.