Merge pull request #10519 from jordan-woyak/fix-hotkey-detections

MappingCommon: Fix detection of hotkey and conjunction expressions.
This commit is contained in:
JMC47 2022-03-19 00:41:00 -04:00 committed by GitHub
commit edd63d8c3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -107,16 +107,18 @@ BuildExpression(const std::vector<ciface::Core::DeviceContainer::InputDetection>
for (auto& detection : detections)
{
// Remove since released inputs.
// Remove since-released inputs.
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();
it = pressed_inputs.erase(it);
}
else
{
++it;
}
}
handle_press(detection);