Developer
WebSocket API
Commands
Overlays

Overlays

Toolbar commands

These do the same thing as the matching Layout Mode toolbar button.

CommandAction
ToggleLayoutModeOpens or closes Layout Mode.
TogglePerformanceStatsShows or hides the performance overlay.
CreateCreates an overlay.
CreateWebBrowserCreates a web browser overlay.
RecenterRecenters the overlay space.
KeyboardShows or hides the keyboard.
SettingsShows or hides the settings panel.
DeleteAllDeletes all overlays.
WindowSwitcherOpens the window switcher.
WindowSettingsShows the active overlay's settings.
WindowSelectShows the active overlay's window picker.
WindowDeleteDeletes the active overlay.

The active overlay is the one whose toolbar was opened most recently.

send('ToggleLayoutMode');

SetActiveOverlaySetting

jsonData{ internalName, value }

Changes a setting on the active overlay. value is always a string.

internalNamevalue
Pin, AutoHide, Lock, BlockInput"true" or "false"
Opacity, Brightness0 – 1
MaxFPS, MinFPSFrame rate
TrackingSpace0 World, 1 HMD, 2 Right Controller, 3 Left Controller
CaptureSelectWindow ID from RequestWindowList

See Overlays for what each one does.

send('SetActiveOverlaySetting', { jsonData: { internalName: 'Opacity', value: '0.5' } });

RequestActiveOverlayInformation

ResponseUpdateActiveOverlayInformation

The response is sent to every connected client, not only the one that asked.

on('UpdateActiveOverlayInformation', (overlay) => console.log(overlay.handle, overlay.opacity));
send('RequestActiveOverlayInformation');
Response
{
  windowId: number          // -1 for web browser overlays
  handle: number
  key: string
  isWebBrowserOverlay: boolean
  browserId: number
  displayName: string | null
  trackingSpace: number     // 0 World, 1 HMD, 2 Right Controller, 3 Left Controller
  isPinned: boolean
  isAutoHide: boolean
  isLocked: boolean
  isInputBlocked: boolean
  brightness: number
  opacity: number
  activeFps: number
  inactiveFps: number
}

RequestWindowList

ResponseUpdateWindowList

Windows and monitors that can be captured, keyed by window ID.

on('UpdateWindowList', (windows) => {
  for (const window of Object.values(windows)) {
    if (window) console.log(window.id, window.title);
  }
});
send('RequestWindowList');
Response
{
  [windowId: string]: {
    id: number
    title: string
    appName: string
    icon: string            // base64 image
    isDesktop: boolean
    isPrimaryDesktop: boolean
    isUWP: boolean
    isSystem: boolean
  }
}

RequestLayoutModeState

ResponseUpdateLayoutModeState

The response's rawData is "True" while Layout Mode is open, otherwise "False".

on('UpdateLayoutModeState', (_, rawData) => console.log('Layout Mode open:', rawData === 'True'));
send('RequestLayoutModeState');