Skip to content

Commit

Permalink
Fix handling multiple "physical key" events in the single input map a…
Browse files Browse the repository at this point in the history
…ction.
  • Loading branch information
bruvzg authored and lekoder committed Dec 18, 2021
1 parent 1dbba54 commit 3b7db36
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions core/os/input_event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,13 @@ bool InputEventKey::shortcut_match(const Ref<InputEvent> &p_event, bool p_exact_
return false;
}

return scancode == key->scancode &&
(!p_exact_match || get_modifiers_mask() == key->get_modifiers_mask());
if (scancode == 0) {
return physical_scancode == key->physical_scancode &&
(!p_exact_match || get_modifiers_mask() == key->get_modifiers_mask());
} else {
return scancode == key->scancode &&
(!p_exact_match || get_modifiers_mask() == key->get_modifiers_mask());
}
}

void InputEventKey::_bind_methods() {
Expand Down

0 comments on commit 3b7db36

Please sign in to comment.