diff --git a/src/clashing_inputs.rs b/src/clashing_inputs.rs index e9255c7a..740a384a 100644 --- a/src/clashing_inputs.rs +++ b/src/clashing_inputs.rs @@ -92,9 +92,19 @@ impl InputMap { clash_strategy: ClashStrategy, ) { for clash in self.get_clashes(action_data, input_streams) { - // Reset the action in the pair that was overruled, if any if let Some(culled_action) = resolve_clash(&clash, clash_strategy, input_streams) { - action_data.insert(culled_action, ActionData::default()); + let culled_action_data = action_data + .raw_entry_mut() + .from_key(&culled_action) + .or_insert_with(|| (culled_action.clone(), ActionData::default())) + .1; + if culled_action_data.state.pressed() { + // Reset the pressed action in the pair that was overruled, if any + culled_action_data.state.release(); + } else { + // Remove the released action in the pair that was overruled, if any + action_data.remove(&culled_action); + } } } }