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: 
dan19
Binge Watcher

Is there a way to observe two rectangles in a layout group to see what one got clicked?

Hello guys!

I am extremely new to Roku development and I am trying to create a custom button (using a custom component) that extends rectangle. I have accomplished this and have also been able to manage the focusing by change the color of the focused rectangle. But I am now stuck on trying to manage the selection. 

For example, when a rectangle has focus and the ok key is pressed, I want to do something, but I am not able to wrap my head around observing for when a rectangle is clicked on like we would normally do with the buttonGroup buttons. So what will be the best way or the way to perform an action on the focused rectangle?

Thanks

0 Kudos
2 REPLIES 2
renojim
Community Streaming Expert

Re: Is there a way to observe two rectangles in a layout group to see what one got clicked?

If I'm following you, you should be able to catch the button press and then check to see if the rectangle has focus.

Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos
dan19
Binge Watcher

Re: Is there a way to observe two rectangles in a layout group to see what one got clicked?

Thanks for the suggestion. I was able to use the "OK" key to perform an action if the button/rectangle in focus has the same ID as the string I am checking it against.

I wish Roku made it easy for us to customize their button.

0 Kudos