Created
April 13, 2025 16:23
-
-
Save annakrasner/321d3b8ac7c2a75b9fd5b2ab173661d6 to your computer and use it in GitHub Desktop.
Godot 4.4 HTML5 exort mouse capture workaround - attach this script in a separate node.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extends Node | |
| func _input(event): | |
| if Input.is_action_just_pressed("mouse_capture"): | |
| Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED) | |
| if Input.is_action_just_pressed("mouse_release"): | |
| Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Also create input maps for "mouse_capture" and "mouse_release"