Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Motorcykey
Visitor

Overriding Back Button functionality on roKeyboardScreen

Hello,

I have a 'Register' screen created using the 'roKeyboardScreen' component. This screen currently is built to accept multiple pieces of information:

  • First Name

  • Last Name

  • Email

  • Password

We have two buttons on the screen to traverse through the form (Back & Next). Clicking 'Next' will save the data that has been input on the Keyboard Screen and refresh the form data for the next piece. (e.g., if you just typed in your First Name and clicked 'Next' then the Keyboard will become blank and ask the user to input their Last Name).

This is all working great, however, upon certification review of the app we were faulted that clicking the 'Back' button on the Remote would close the roKeyboardScreen altogether. I noticed this Screen component did not contain an 'isRemoteKeyPressed' Event like other screens and as a result, hitting back on the remote triggers the isScreenClosed() event and simply closes the screen. This is why we've included the 'Back' button on the screen as a means for our users to traverse backward through the form, however, this did not seem to satisfy the needs of the certification review.

I was in touch with a contact from Roku on how I can resolve this issue and successfully override the back button without closing the screen. They informed me to leverage the isScreenClosed() event and run my code which traverses the form backward.

I did try this, and while it did work, the screen still closed after my code ran. It seems all I'm missing is how to return out of the default isScreenClosed() functionality and prevent the screen from closing when a user hits the 'Back' button the remote for the roKeyboardScreen.

Thanks for any advice!

-Mikey
0 Kudos
2 REPLIES 2
destruk
Binge Watcher

Re: Overriding Back Button functionality on roKeyboardScreen

If you crate a facade screen, then when a keyboard screen is closed with the back button and another keyboard screen is created, the app won't exit unless it's the first screen created after the facade screen.
0 Kudos
Motorcykey
Visitor

Re: Overriding Back Button functionality on roKeyboardScreen

That's what I was afraid of since I had 2 separate screens with 6 fields across them I felt this might be too many facades, but it seems to be working. Thanks for the feedback!
0 Kudos