diff --git a/roku/components/Guide.brs b/roku/components/Guide.brs
index 2001c51..efbb96f 100644
--- a/roku/components/Guide.brs
+++ b/roku/components/Guide.brs
@@ -13,7 +13,7 @@ sub showPanel(mode as string, title as string, status as string, titles as objec
m.menu.jumpToItem = 0
m.panel.visible = true
if titles.Count() = 0
- m.top.SetFocus(true)
+ m.remoteFocus.SetFocus(true)
else
m.menu.SetFocus(true)
end if
@@ -22,7 +22,7 @@ end sub
sub closePanel()
m.panelMode = ""
m.panel.visible = false
- m.top.SetFocus(true)
+ m.remoteFocus.SetFocus(true)
end sub
sub onMenuSelect(event as object)
diff --git a/roku/components/RetroScene.brs b/roku/components/RetroScene.brs
index a9d1555..f2b3783 100644
--- a/roku/components/RetroScene.brs
+++ b/roku/components/RetroScene.brs
@@ -1,5 +1,5 @@
sub init()
- for each id in ["video", "weather", "banner", "channelTitle", "clock", "nowTitle", "nextTitle", "progressTrack", "progress", "playbackStatus", "panel", "panelTitle", "panelStatus", "menu", "bannerTimer", "clockTimer", "retryTimer", "guideDetails", "guideChannelTitle", "guideNow", "guideNext", "guideLater"]
+ for each id in ["video", "weather", "banner", "channelTitle", "clock", "nowTitle", "nextTitle", "progressTrack", "progress", "playbackStatus", "panel", "panelTitle", "panelStatus", "menu", "bannerTimer", "clockTimer", "retryTimer", "guideDetails", "guideChannelTitle", "guideNow", "guideNext", "guideLater", "remoteFocus"]
m[id] = m.top.FindNode(id)
end for
m.channels = []
@@ -189,6 +189,7 @@ sub playLinear(channel as object)
m.video.content = content
m.videoChannelId = channel.id
m.video.control = "play"
+ restoreRemoteFocus()
end sub
sub refreshSchedule()
@@ -288,7 +289,17 @@ sub setPlaybackStatus(message as string)
m.playbackStatus.visible = true
end sub
+sub restoreRemoteFocus()
+ if m.top.dialog <> invalid and m.top.dialog.IsInFocusChain() then return
+ if m.panel.visible and m.menu.content <> invalid and m.menu.content.GetChildCount() > 0
+ if not m.menu.HasFocus() then m.menu.SetFocus(true)
+ else if not m.remoteFocus.HasFocus()
+ m.remoteFocus.SetFocus(true)
+ end if
+end sub
+
sub onVideoState()
+ restoreRemoteFocus()
if m.weather.visible
if m.video.state = "error" or m.video.state = "finished" then hideWeatherPreview()
return
@@ -320,7 +331,7 @@ function onKeyEvent(key as string, press as boolean) as boolean
closePanel()
return true
end if
- if key = "options" and m.channels.Count() > 0
+ if key = "options" and (m.channelIndex >= 0 or m.panelMode = "guide" or m.panelMode = "options")
if m.panelMode = "guide"
showPanel("options", "retroLabs", m.server.name + " " + m.server.baseUrl, ["Program guide", "Refresh channels", "Change server"])
else
@@ -335,6 +346,9 @@ function onKeyEvent(key as string, press as boolean) as boolean
if key = "up" then direction = -1
openGuide(direction)
return true
+ else if key = "right"
+ openGuide()
+ return true
else if key = "left" or key = "replay"
if m.previousIndex >= 0 then tune(m.previousIndex)
return true
diff --git a/roku/components/RetroScene.xml b/roku/components/RetroScene.xml
index dcd8abb..db7b572 100644
--- a/roku/components/RetroScene.xml
+++ b/roku/components/RetroScene.xml
@@ -4,7 +4,8 @@
-
+
+
@@ -63,7 +64,7 @@
-
+
diff --git a/roku/components/Weather.brs b/roku/components/Weather.brs
index 660f031..42ed269 100644
--- a/roku/components/Weather.brs
+++ b/roku/components/Weather.brs
@@ -2,6 +2,7 @@ sub initWeather()
for each id in ["weatherLocation", "weatherHeading", "weatherBody", "weatherAlerts", "weatherSource", "weatherRotation", "weatherRefresh", "weatherAudio", "weatherPreviewFrame", "weatherPreviewLabel", "forecastCards"]
m[id] = m.top.FindNode(id)
end for
+ m.weatherAudio.ObserveField("state", "restoreRemoteFocus")
m.weatherRotation.ObserveField("fire", "rotateWeather")
m.weatherRefresh.ObserveField("fire", "refreshWeather")
end sub
@@ -166,6 +167,7 @@ sub updateWeatherMusic(path as dynamic)
track.streamFormat = "mp3"
m.weatherAudio.content = track
m.weatherAudio.control = "play"
+ restoreRemoteFocus()
end sub
function showForecastCards(periods as object) as boolean