浏览代码

Fix handling multiple "physical key" events in the single input map action.

bruvzg 3 年之前
父节点
当前提交
b97ca39360
共有 1 个文件被更改,包括 7 次插入2 次删除
  1. 7 2
      core/os/input_event.cpp

+ 7 - 2
core/os/input_event.cpp

@@ -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() {