Events Received
After you connect to the StreamDock SDK, you will receive the following event notifications:
| Event Type | Description |
|---|---|
| deviceDidConnect | Device connected |
| deviceDidDisconnect | Device disconnected |
| read | Key and knob operation events |
| getFirmVersion | Firmware version query result |
deviceDidConnect
This event is received when a new StreamDock device is connected to your computer.
{
"event": "deviceDidConnect",
"path": "Unique device identifier",
"payload": {
"Path": "Device path",
"VendorID": 1234,
"ProductID": 5678,
"SerialNumber": "SN123456",
"Manufacturer": "ManufacturerName",
"Product": "ProductName",
"FirmwareVersion": "1.0.0",
"ReleaseNumber": 1,
"Type": "N4Pro"
}
}
Event Description:
event: Event type, fixed as "deviceDidConnect"path: Unique device identifier, required for subsequent operationspayload: Contains detailed device information
Usage Recommendations:
- After receiving this event, you can start setting the device background and key icons
- It's recommended to save the device path for subsequent operations
deviceDidDisconnect
This event is received when the StreamDock device is disconnected from the computer.
{
"event": "deviceDidDisconnect",
"path": "Unique device identifier",
"payload": {
"Path": "Device path",
"VendorID": 1234,
"ProductID": 5678,
"SerialNumber": "SN123456",
"Manufacturer": "ManufacturerName",
"Product": "ProductName",
"FirmwareVersion": "1.0.0",
"ReleaseNumber": 1,
"Type": "N4Pro"
}
}
Event Description:
event: Event type, fixed as "deviceDidDisconnect"path: Unique identifier of the disconnected devicepayload: Contains detailed information of the disconnected device
Usage Recommendations:
- After receiving this event, you should stop operations on this device
- You can update the UI state to notify the user that the device has been disconnected
read
Key events and knob events (reading will only start after sending a read event)
Key events
{
"event": "read",
"path": "path",
"payload": {
"keyId": 5,
"keyUpOrKeyDown": "keyDown"
}
}
| Member | Description |
|---|---|
| event | read |
| path | Device path (unique identifier) |
| payload | json |
The payload object contains the following members:
| payload | Description |
|---|---|
| keyId | Key number (starts from 1) |
| keyUpOrKeyDown | Key press (keyDown) or release (keyUp) |
Knob rotation events
{
"event": "read",
"path": "path",
"payload": {
"knobId": 1,
"direction": "left"
}
}
| Member | Description |
|---|---|
| event | read |
| path | Device path (unique identifier) |
| payload | json |
The payload object contains the following members:
| payload | Description |
|---|---|
| knobId | Knob number (starts from 1) |
| direction | Rotation direction ("left" or "right") |
Knob press events
{
"event": "read",
"path": "path",
"payload": {
"knobId": 1,
"state": "pressed"
}
}
| Member | Description |
|---|---|
| event | read |
| path | Device path (unique identifier) |
| payload | json |
The payload object contains the following members:
| payload | Description |
|---|---|
| knobId | Knob number (starts from 1) |
| state | State ("pressed") |
Swipe events
{
"event": "read",
"path": "path",
"payload": {
"direction": "left"
}
}
| Member | Description |
|---|---|
| event | read |
| path | Device path (unique identifier) |
| payload | json |
The payload object contains the following members:
| payload | Description |
|---|---|
| direction | Swipe direction ("left", "right") |
getFirmVersion
Return value of getFirmVersion
{
"event": "getFirmVersion",
"path": "path",
"payload": {
"firmVersion": "firmVersion"
}
}
| Member | Description |
|---|---|
| event | getFirmVersion |
| path | Device path (unique identifier) |
| payload | json |
The payload object contains the following members:
| payload | Description |
|---|---|
| firmVersion | Device firmware version number |
