An roInput object can be used to receive events sent from a network client using the External Control Protocol (ECP), as described in External Control API.

Note that a channel that wants to accept deep link parameters while running without relaunching the channel must set the supports_input_launch manifest flag. This functionality will not work unless the flag is set.

Supported Interfaces

Supported Events

Description

See External Control Service Commands for information about the ECP input command.

This object is created without any arguments:

  • CreateObject("roInput")

Example

The following printsĀ information received from an external device inĀ JSON format. If the external device sends the following input command:

curl -d '' '<roku_target_device>:8060/input?my_event=My%20Test&x=100&y=200&action=start'

The following will be printed:

{"action":"start","my_event":"My Test","x":"100","y":"200"}

roInput Example
msgPort = CreateObject("roMessagePort")

input = CreateObject("roInput")
input.SetMessagePort(msgPort)

print "Waiting for messages..."
while true
  msg = wait(0, msgPort)
  if type(msg) = "roInputEvent"
    if msg.IsInput()
      info = msg.GetInfo()
      print "Received input: "; FormatJSON(info)
    end if
  end if
end while