Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add function to disable cursor #803

Open
Noofbiz opened this issue Dec 14, 2023 · 1 comment
Open

Add function to disable cursor #803

Noofbiz opened this issue Dec 14, 2023 · 1 comment

Comments

@Noofbiz
Copy link
Member

Noofbiz commented Dec 14, 2023

For things like First-Person games, the cursor should be locked to the window, so moving too far left or right out of the window doesn't stop the gameplay.

@brunoga
Copy link

brunoga commented Jun 24, 2024

I assume you are talking about desktop, right? FWIIW, I accomplished this by doing this (I do have a "game" using engo that requires the behavior you describe):

        // Disable cursor.
	if engo.CurrentBackEnd == engo.BackEndGLFW ||
		engo.CurrentBackEnd == engo.BackEndVulkan {
		glfw.GetCurrentContext().SetInputMode(glfw.CursorMode,
			glfw.CursorDisabled)
	} else {
		panic("Backend does not seem to support mouse capture.")
	}

https://github.com/brunoga/robomaster-control/blob/c6764bc8fee10ad3c8fa50899809f175ad0c068a/scenes/robomaster.go#L59

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants