Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
chaklasiyanikun
Level 11

How to handle press = "<uninitialized>" in Parent Node?

I added an RSG component inside an SGDex view. and tried to manage RSG Component key handler in SGDex View. So, I added one line in the RSG Component key handler "handler = false" in whatever key I required EX: "options" key. So, handler Automatically transfers to a parent component. But, I set RSG Component key handler like below.

if key = "options" then
     handled = false 
end if

and Inside an SGDex View key handler, I'm getting press = "<uninitialized>". Does anyone know how to handle this (press = "<uninitialized>").

I tried with the same thing and added RSG Component inside an RSG Component. It's working fine. I set child RSG Component key handler "options" key "handled = false". it's successfully transferred child key handler to parent RSG Component key handler. And Parent RSG Component key handler return press value = "true" For options key.

0 Kudos
3 Replies
chaklasiyanikun
Level 11

Re: How to handle press = "<uninitialized>" in Parent Node?

Any Solution for this issue.

0 Kudos
necrotek
Level 11

Re: How to handle press = "<uninitialized>" in Parent Node?

if you are handling keypress in 

onKeyEvent()

then press should be boolean 

 

 

https://developer.roku.com/en-gb/docs/references/scenegraph/component-functions/onkeyevent.md

returning true or false will determine if your parent will also catch the onKeyEvent()

0 Kudos
chaklasiyanikun
Level 11

Re: How to handle press = "<uninitialized>" in Parent Node?


@necrotek wrote:

if you are handling keypress in 

onKeyEvent()

then press should be boolean 

 

 

https://developer.roku.com/en-gb/docs/references/scenegraph/component-functions/onkeyevent.md

returning true or false will determine if your parent will also catch the onKeyEvent()


I know that the onKeyEvent() returning true or false And I also know the parent will also catch the onKeyEvent(). But, I not facing this problem with RSG Component. this problem only Facing with the SGDex View. I tried to catch onKeyEvent() value in Parent. But, Here, I found <uninitialized> press value. I transferred the key both ways. Using a return false in the child node and Without value set Automatic transferred. But, Both the way I getting the <uninitialized> press value. I don't know how to handle it <uninitialized> value in Roku.

 

0 Kudos