MappingCommon: Fix detection of hotkey and conjunction expressions.

This commit is contained in:
Jordan Woyak 2022-03-16 22:25:04 -05:00
parent bf261f6144
commit b589d720bf
1 changed files with 4 additions and 2 deletions

View File

@ -107,17 +107,19 @@ BuildExpression(const std::vector<ciface::Core::DeviceContainer::InputDetection>
for (auto& detection : detections) for (auto& detection : detections)
{ {
// Remove since released inputs. // Remove since-released inputs.
for (auto it = pressed_inputs.begin(); it != pressed_inputs.end();) for (auto it = pressed_inputs.begin(); it != pressed_inputs.end();)
{ {
if (!((*it)->release_time > detection.press_time)) if ((*it)->release_time && (*it)->release_time <= detection.press_time)
{ {
handle_release(); handle_release();
it = pressed_inputs.erase(it); it = pressed_inputs.erase(it);
} }
else else
{
++it; ++it;
} }
}
handle_press(detection); handle_press(detection);
} }