Options
All
  • Public
  • Public/Protected
  • All
Menu

Module rc/command

Index

Variables

powerStatusCommands: { MOMENTARY_PRESS: Buffer; POWER_CYCLE: Buffer; PRESS_AND_HOLD: Buffer; SYSTEM_RESET: Buffer } = ...

Type declaration

  • MOMENTARY_PRESS: Buffer
  • POWER_CYCLE: Buffer
  • PRESS_AND_HOLD: Buffer
  • SYSTEM_RESET: Buffer

Functions

  • formatCommand(command: number, args?: Uint8Array): Buffer
  • Commands sent to server are a 16-bit LE followed by optional arguments The 8 upper bits seem to have flags.

    Parameters

    • command: number
    • Optional args: Uint8Array

    Returns Buffer

  • formatKeyboardCommand(hidKeycodes: number[]): Buffer
  • Note: Excluding DV keycodes, only the first 6 keycodes in the array will be sent.

    Parameters

    • hidKeycodes: number[]

    Returns Buffer

  • formatMouseCommand(x: number, y: number, buttons: number): Buffer
  • Screen coordinates should be divided by screen width / height first, so they end up in range [0, 1].

    buttons is a bitfield of the pressed buttons: bit 0 is the 'left' button, bit 1 is the 'right' button, and bit 2 is the middle button.

    Parameters

    • x: number
    • y: number
    • buttons: number

    Returns Buffer

Generated using TypeDoc