Forum Discussion
The code provided in the medium blog link seems fine.
Share what you have done to get help.
I have used same code. There is no difference in my code for Exit dialog box.
- renojim12 months agoCommunity Streaming Expert
I suggest you add print statements to the code to figure out what's going on. I suspect the key press isn't getting to the onKeyEvent function in MainScene.brs. For example, add:
print key,press
at the beginning of the onKeyEvent function and:
print msgType
in the event loop. If you never see "back true" on the debug console you'll know the remote button press never made it to onKeyEvent.
I've found peppering my code with prints is the best way to figure out what SceneGraph is doing.
- RokuBen12 months agoCommunity Moderator
Note, this will only catch a user hitting the back button to exit from your main screen. There's no way to intercept using the home button to return to home screen or using a partner button to launch another channel.
- raxitpandya12 months agoBinge Watcher
Thanks for the reply. in my code, onKeyEvent get executed but i have added the condition
if press and key = "back" then
Code inside this condition is not getting executed.