while (true)
msg = wait(0, port)
print "type(msg): ",type(msg)
print "msg.GetMessage(): ",msg.GetMessage()
if (type(msg) = "roInput")
print "Got the message: ", msg.url
end if
end while
The external control server places these name-value pairs into a BrightScript associative array and passes them directly through to the currently executing channel script via a Message Port attached to a created roInput object.
...
Messages of type roInputEvent have a GetInfo() method that will obtain the associative array.
"adrianc1982" wrote:
Does anyone has a working example or ecp for inputs?
Sub Main ()
inputObject = CreateObject ("roInput")
port = CreateObject ("roMessagePort")
inputObject.SetMessagePort (port)
While True
msg = Wait (0, port)
If Type (msg) = "roInputEvent"
info = msg.GetInfo ()
Print info
EndIf
End While
End Sub
import urllib.parse
import requests
params = {'a': 123, 'b':'Hello, World!'}
r = requests.post ('http://192.168.0.6:8060/input?' + urllib.parse.urlencode (params))
BrightScript Debugger> ------ Running ------
a: 123
b: Hello, World!
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!