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: 
Hardik
Visitor

Not getting OnKeyEvent in Component Library

Hello All,

I am trying to create ComponentLibrary for ROKU.
https://sdkdocs.roku.com/display/sdkdoc/ComponentLibrary

I have followed sample and able to run sample app.
Now I am trying to add onKeyEvent in library.
---
Function onKeyEvent(key as String, press as Boolean) as Boolean
---

But when I press key, I am not receiving anything.
Can you please help as I am stuck, how we will get onKeyEvent in component library.

Thanks,
Hardik
0 Kudos
2 REPLIES 2
acreskey
Visitor

Re: Not getting OnKeyEvent in Component Library

Possibly the component doesn't have focus?
0 Kudos
kisuke
Binge Watcher

Re: Not getting OnKeyEvent in Component Library

Hi. I have exactly the same problem. I assume you should add the focus to the ComponentLibrary. How did you do it?

0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.