mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-03-21 17:34:57 -05:00
Add support for multi-action stream deck buttons
It has to be noted however: * multi-action buttons don't have any coordinates * multi-action buttons send the "up" and "down" event at the same time. (When the multi-action button is released) Thus they might arrive in the wrong order due to network latency.
This commit is contained in:
parent
395a18fa4c
commit
756d7bbd3c
|
|
@ -48,14 +48,25 @@ void receiveStreamDeckMessage(obs_data_t *request_data, obs_data_t *)
|
|||
}
|
||||
message.keyDown = obs_data_get_bool(data, "isKeyDownEvent");
|
||||
|
||||
OBSDataAutoRelease coordinates = obs_data_get_obj(data, "coordinates");
|
||||
if (!coordinates) {
|
||||
printParseError(request_data);
|
||||
return;
|
||||
}
|
||||
const bool isMultiAction = obs_data_get_bool(data, "isInMultiAction");
|
||||
if (!isMultiAction) {
|
||||
OBSDataAutoRelease coordinates =
|
||||
obs_data_get_obj(data, "coordinates");
|
||||
if (!coordinates && !isMultiAction) {
|
||||
printParseError(request_data);
|
||||
return;
|
||||
}
|
||||
|
||||
message.row = obs_data_get_int(coordinates, "row");
|
||||
message.column = obs_data_get_int(coordinates, "column");
|
||||
message.row = obs_data_get_int(coordinates, "row");
|
||||
message.column = obs_data_get_int(coordinates, "column");
|
||||
} else {
|
||||
message.row = 0;
|
||||
message.column = 0;
|
||||
vblog(LOG_INFO,
|
||||
"received multi action stream deck message"
|
||||
" - setting coordinates to (%d, %d)",
|
||||
message.row, message.column);
|
||||
}
|
||||
|
||||
OBSDataAutoRelease settings = obs_data_get_obj(data, "settings");
|
||||
if (!settings) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user