mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-26 06:18:32 +00:00
InputCommon: Make hotkeys and input detection aware of Ctrl -> L_Ctrl / R_Ctrl hierarchy.
This commit is contained in:
parent
aae913fbc6
commit
d8ad8c3861
4 changed files with 65 additions and 44 deletions
|
@ -291,9 +291,14 @@ bool HotkeySuppressions::IsSuppressedIgnoringModifiers(Device::Input* input,
|
|||
auto it = m_suppressions.lower_bound({input, nullptr});
|
||||
auto it_end = m_suppressions.lower_bound({input + 1, nullptr});
|
||||
|
||||
// We need to ignore L_Ctrl R_Ctrl when supplied Ctrl and vice-versa.
|
||||
const auto is_same_modifier = [](Device::Input* i1, Device::Input* i2) {
|
||||
return i1 == i2 || i1->IsChild(i2) || i2->IsChild(i1);
|
||||
};
|
||||
|
||||
return std::any_of(it, it_end, [&](auto& s) {
|
||||
return std::none_of(begin(ignore_modifiers), end(ignore_modifiers),
|
||||
[&](auto& m) { return m->GetInput() == s.first.second; });
|
||||
[&](auto& m) { return is_same_modifier(m->GetInput(), s.first.second); });
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue