Function onKeyEvent(key as String, press as Boolean) as Boolean
handled = false
if press
if key = "down"
? "down was pressed"
m.button.setFocus(True)
handled = True
else
m.button.setFocus(False)
m.top.setFocus(True)
? "some other button was pressed"
handled = True
end if
end if
return handled
end Function
<?xml version = "1.0" encoding = "utf-8" ?>
<component name = "HelloWorld" extends = "Scene" >
<script type="text/brightscript" uri="pkg:/components/helloworld_scene.brs" />
<children >
<Label
id = "TownName"
text = "Sacramento, CA"
color = "#FFFFFF"
translation="[300, 50]"
font = "font:LargeBoldSystemFont"
/>
<Poster
id="sunnyImage"
uri="pkg:/images/weather_sunny.png"
width="0"
height="0"
translation="[50,40]"
/>
<Button
id="button3"
minWidth="300"
text="Click Me"
translation="[200, 200]"
showFocusFootprint = "true"
/>
<Rectangle
id = "exampleRectangle"
width = "512"
height = "288"
color = "#FFFFFF"
translation = "[40, 500]"
opacity=".5">
<Label
id = "buttonLabel1"
width="0"
text = "Sample Button Text"
color="#000000"
/>
</Rectangle>
</children>
</component>
focusable="true"
We’re upgrading Roku Community to bring you a faster, more mobile-friendly experience. You may notice limited functionality or read-only access during this time. Read more here.
Planned Downtime:
Community will be unavailable for up to 24–48 hours during the upgrade window during the week of May 19th and you may notice reduced functionality.
In the meantime, for additional assistance, visit our Support Site.
We're sorry for this disruption — we’re excited to share what’s next!