Skip to content

Commit 62d3a6d

Browse files
committed
Modifying processing of pause actions in keyboard action sequences
The vast majority of use of pause actions in a keyboard action sequence are used to synchronize the entire action chain with other (mouse) action sequences. To allow the driver to properly synchronize the input sequences, the driver will now ignore the duration property of pause events in keyboard action sequences. This is deliberately in violation of the W3C specification, and may be revisited in the future.
1 parent 19d617f commit 62d3a6d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

cpp/iedriver/InputManager.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,16 @@ int InputManager::GetTicks(const Json::Value& sequences, Json::Value* ticks) {
185185
}
186186
Json::UInt action_index = static_cast<Json::UInt>(j);
187187
Json::Value action = actions[action_index];
188+
if (device_type == "key" &&
189+
action.isMember("type") &&
190+
action["type"].isString() &&
191+
action["type"].asString() == "pause") {
192+
// HACK! Ignore the duration of pause events in keyboard action
193+
// sequences. This is deliberately in violation of the W3C spec.
194+
// This allows us to better synchronize mixed keyboard and mouse
195+
// action sequences.
196+
action["duration"] = 0;
197+
}
188198
(*ticks)[action_index].append(action);
189199
}
190200
}

0 commit comments

Comments
 (0)