Events
Instead of polling, send SubscribeToEvents with a list of tags. XSOverlay sends the matching Update… message right away, then again whenever it changes.
on('UpdateDateTime', (time) => console.log(time.Time));
send('SubscribeToEvents', { jsonData: ['DateAndTime', 'Theme', 'MediaPlayer'] });Tags
Tag names are case-insensitive.
| Tag | Sends |
|---|---|
DateAndTime | UpdateDateTime |
DeviceInformation | UpdateDeviceInformation |
Theme | UpdateTheme |
LayoutMode | UpdateLayoutModeState |
MediaPlayer | UpdateMediaPlayer |
KeyboardLayout | UpdateKeyboardLayout |
KeyboardState | UpdateKeyboardState |
Languages | UpdateLanguageList |
LanguageMap | UpdateLanguageMap |
WindowList | UpdateWindowList |
ActiveOverlay | UpdateActiveOverlayInformation |
Settings | UpdateSettings |
Performance | UpdateRuntimePerformance |
Notifications | Notification, with a notification object, for every notification shown |
Unsubscribing
Send UnsubscribeToEvents with the tags to stop.
send('UnsubscribeToEvents', { jsonData: ['DateAndTime'] });