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

isRemoteKeyPressed

I'm trying to capture the remote key presses in a springboard, but I'm only getting a response from the right (5) and left (4) buttons. I've used the up, down and info (*) buttons with an imagecanvas, but I can't seem to get it right with a springboard screen. I've tried numerous iterations, but nothing is returning a response. Shouldn't the following print more than just the right and left button presses? I've also tried isButtonInfo with no luck either. Can someone explain the right usage?
        if type(msg) = "roSpringboardScreenEvent" then
if msg.isScreenClosed()
print "Screen closed"
exit while
else if msg.isRemoteKeyPressed()
print "Remote key pressed"
0 Kudos
8 REPLIES 8
RokuJoel
Binge Watcher

Re: isRemoteKeyPressed

The only buttons available on roSprinboard with isRemoteKeyPressed() are the left and right buttons. Otherwise, you are looking for msg.IsbuttonPressed() with msg.getindex() to tell you which buttons *on the screen* were pressed.

if type(msg)="roSpringboardScreenEvent" then
if msg.isbuttonpressed() then
ndx=msg.getindex()
if ndx=0 then
?"button number: ";ndx;" pressed"
else if msg.getindex()=1 then
?"button number: ";ndx;" pressed"
end if
else if msg.isremotekeypressed()
key=msg.getindex()
?"Key Number: ";key;" Pressed"
end if
end if

- Joel
0 Kudos
agmark
Visitor

Re: isRemoteKeyPressed

Is the info (*) button available on any screen other than an imagecanvas?
0 Kudos
RokuChris
Roku Employee
Roku Employee

Re: isRemoteKeyPressed

"agmark" wrote:
Is the info (*) button available on any screen other than an imagecanvas?


Off the top of my head, the (*) button raises...
  • isListItemInfo() on roPosterScreen

  • isRemoteKeyPressed() on roGridScreen

  • roUniversalControlEvent on roScreen


...there may be others that I'm forgetting.
0 Kudos
agmark
Visitor

Re: isRemoteKeyPressed

Thanks Chris. Tried isListItemInfo() on roPosterScreen and it responds. That's where I'll use it. I don't have a Roku1, but I assume the info button is strickly Roku2?
0 Kudos
RokuChris
Roku Employee
Roku Employee

Re: isRemoteKeyPressed

"agmark" wrote:
Thanks Chris. Tried isListItemInfo() on roPosterScreen and it responds. That's where I'll use it. I don't have a Roku1, but I assume the info button is strickly Roku2?


The (*) button works with any Roku since firmware 2.7. See section 2.4 of the Component Reference.
0 Kudos
belltown
Roku Guru

Re: isRemoteKeyPressed

"RokuChris" wrote:

The (*) button works with any Roku since firmware 2.7. See section 2.4 of the Component Reference.

... assuming you have a (*) button. My Roku 1 remote does not have an info or (*) button.
0 Kudos
gonzotek
Visitor

Re: isRemoteKeyPressed

"belltown" wrote:
"RokuChris" wrote:

The (*) button works with any Roku since firmware 2.7. See section 2.4 of the Component Reference.

... assuming you have a (*) button. My Roku 1 remote does not have an info or (*) button.
Network remotes like Remoku, DVPRemote or the official Roku app (among others) have it and will work with any generation Roku. I frequently recommend the use of a network remote to early Roku1 owners when they ask how to re-arrange channels in the general discussion forum. It's probably not a good idea to code any critical functionality to the star/info button if you plan for a channel to be available to those models lacking the button(since most users probably won't go looking in the forum for the answer), but if it's a less-important or infrequently used feature it's probably ok to use it; another option is to also offer the same functionality via some on-screen menu or another button. Just some fyi opinion for anyone coming across this thread. 🙂
Remoku.tv - A free web app for Roku Remote Control!
Want to control your Roku from nearly any phone, computer or tablet? Get started at http://help.remoku.tv
by Apps4TV - Applications for television and beyond: http://www.apps4tv.com
0 Kudos
destruk
Streaming Star

Re: isRemoteKeyPressed

We've ended up using the down button for that in some screens - that way it works for all remotes without external or extra dependencies.
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.