Keep Roku remote focus on the tuner and guide
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user