Function simulateKeypress( key as String ) As Void
url = "http://127.0.0.1:8060/keydown/" + key
print "Simulating keypress: " key " as url " url
http = CreateObject("roUrlTransfer")
http.SetUrl( url )
http.PostFromString( "\r\n\r\n" )
Currently, if you go to the poster screen with a single playlist, the user's focus is on the playlist name and the user has to hit the down arrow to allow selection of videos. This is lame. If there's only a single option, you shouldn't have a UI focus point for it.
Cool, omitting 'SetListNames' fixes that.
I'll look further into trying to pull the box IP so I can send keystrokes to myself. I didn't see any sample code for that in the "roPosterScreen" section of the ComponentReference.pdf, but I'll keep on greppin.
di = CreateObject("roDeviceInfo")
ipAddrs = di.GetIPAddrs()
ipAddr = ipAddrs.eth0
REM See the ECP document examples for how to obtain your plugin ID
url = "http://"+ ipAddr +":8060/launch/11?contentID=<PluginID>"
bodyString = ""
print "roku url: "; url
port = CreateObject("roMessagePort")
request = createObject("roUrlTransfer")
response = request.asyncPostFromString(bodyString)
msg = wait(0, port)
if type(msg) = "roUrlEvent"
if msg.getInt() = 1 then
print "Response code: "; msg.GetResponseCode()
if msg.GetResponseCode() = 404
response = invalid
response = msg.getString()