screen = CreateObject("roSGScreen")
m.port = CreateObject("roMessagePort")
screen.setMessagePort(m.port)
' ...
while(true)
msg = wait(0, m.port)
' the roku-remote events are not handled here so what's the point in bslUniversalControlEventCodes()
"vrihlea" wrote:
a) Is there a way to get the button-press event before it gets to the "onKeyEvent()" in the component ?
one use case for this would be to disable the quick-play (or the remote) so that it won't be possible to press it multiple times
"vrihlea" wrote:
b)
what would be a possible use-case for bslUniversalControlEventCodes() and bslBrightScriptErrorCodes() ?
"RokuNB" wrote:"vrihlea" wrote:
a) Is there a way to get the button-press event before it gets to the "onKeyEvent()" in the component ?
one use case for this would be to disable the quick-play (or the remote) so that it won't be possible to press it multiple times
Yes - by temporarily setting the input focus on another node (regardless whether parent or sibling of the current one) and handling it there. Or not handling it (with chance of beep or exit). The point is, excluding the component at hand from the key event handling chain
screen = CreateObject("roSGScreen")
' m.port = CreateObject("roMessagePort")
m.port = CreateObject("roUniversalControlEvent")
screen.setMessagePort(m.port)
while true
msg = wait(0, screen.GetMessagePort())
if type(msg) = "roPosterScreenEvent"
if msg.isRemoteKeyPressed()
stop
end if
end if
"vrihlea" wrote:screen = CreateObject("roSGScreen")
' m.port = CreateObject("roMessagePort")
m.port = CreateObject("roUniversalControlEvent")
screen.setMessagePort(m.port)
while true
msg = wait(0, screen.GetMessagePort())
if type(msg) = "roPosterScreenEvent"
if msg.isRemoteKeyPressed()
stop
end if
end if
it never gets to the "stop", did I miss something ?