Skip to main content

Remote API

Not Available

This API is not yet available, but will be in a future version. Please see the Control API.

Press

remote.press()

Sends a remote command to the TV with either a short press or a long press

SIGNATURE

remote.press(
keyCode: KeyCode
duration: KeyPress = KeyPress.Short
numberOfTimes: Number = 1
intervalInMs: Number = 1
)
returns void

USAGE

remote.press(Key.Down)

remote.press(Key.Down, KeyPress.Long)

-- Press Home every 100ms 5 times
remote.press(Key.Home, KeyPress.Short, 5, 100)

Hold

For use cases where a long hold will not do and the remote must be held until an event happens

remote.holdUntil()

SIGNATURE

remote.holdUntil(
keyCode: KeyCode
fnToReturnTrue: Function(frame: Frame)
options: HoldUntilOptions = {}
)
returns void

USAGE

remote.hold(Key.OK, function (frame)
secretMenuIsOpen = detect.text("Menu", frame)

return secretMenuIsOpen
end)

remote.hold()

Warning: It is recommended that you use holdUntil instead. This is a stateful method. Once triggered it will execute the rest of your code and continue to hodl until the timeout.

SIGNATURE

remote.hold(
keyCode: KeyCode
timeoutInMs: Number = 10_0000
)
returns KeyHoldInstance

USAGE

keyPress = remote.hold(Key.OK)

wait(500)

remote.release(keyPress)

remote.release()

To be used in conjuction with remote.hold()

SIGNATURE

remote.release(
keyPress: KeyPressInstance
)
returns void

USAGE

keyPress = remote.hold(Key.OK)

wait(500)

remote.release(keyPress)

remote.tap()

Tap screen at given x- and y-coordinate (mobile only). Coordinates are normalized between 0.0 and 1.0.

SIGNATURE

remote.tap(
x: Number,
y: Number,
)
returns void

USAGE

remote.tap(0.4, 0.3)

Advanced

See device.configureRemoteProtocol() within the Device API for advanced control

Type Definitions

enum Key

Options available for KeyCode

Standard

  • Key.Up
  • Key.Down
  • Key.Left
  • Key.Right
  • Key.Home
  • Key.Back
  • Key.OK

Numbers`

  • Key.Number1
  • Key.Number2
  • Key.Number3
  • Key.Number4
  • Key.Number5
  • Key.Number6
  • Key.Number7
  • Key.Number8
  • Key.Number9
  • Key.Number0

enum KeyPress

Options available for PressDuration

  • KeyPress.Short
  • KeyPress.Long