godotengine / godot-demo-projects

Demonstration and Template Projects
https://godotengine.org
MIT License
5.48k stars 1.53k forks source link

In 3d/global_illumination, the "toggle_mouse_capture" does not work #1004

Closed joseph-sch closed 3 months ago

joseph-sch commented 7 months ago

Which demo project is affected:

3d/global_illumination

OS/device including version:

N/R

Issue description:

The overlay says "Escape or F10: Toggle mouse capture" but "toggle_mouse_capture" is not mapped to any of these keys in the project settings.

The issue is in the project.godot file:

https://github.com/godotengine/godot-demo-projects/blob/4a4b46cbe1f5105b664b99f325984096151b75a1/3d/global_illumination/project.godot#L70-L75

The two codes 16777217 and 16777253 correspond to 0x1000001 and 0x1000025 respectively, so the first one is not a valid mapping and the second one maps to KEY_MASK_CMD_OR_CTRL + KEY_PERCENT (which cannot be obtained because the percent key requires pressing Shift, unless I'm mistaken).

The correct lines should be, I assume, like in other 3D projects, e.g.:

https://github.com/godotengine/godot-demo-projects/blob/4a4b46cbe1f5105b664b99f325984096151b75a1/3d/waypoints/project.godot#L59-L64

There are other mappings that appear invalid (see highlighted in yellow in screenshot), but they are not critical.

Screenshots of issue:

image

Calinou commented 7 months ago

This is an issue caused by upgrading the project to Godot 4, which broke a lot of key bindings. Many other demos may have similar broken binding (I suggest grepping for the keycode value across all projects' project.godot files).

The intended keys are Escape and F10 here.

joseph-sch commented 7 months ago

I checked all projects which use the toggle_mouse_capture and that input is incorrectly mapped only in 3d/global_illumination.

But indeed, there seem to be other input mapping issues in many project.godot files. For example, these all contain 16777217 or 16777218 i.e. 0x1000001 or 0x1000002:

image