0 votes

I'm trying to set my mouse position with help of some old article, but "Input.warpmousepos(Vector2())" brings up an error and "getviewport().warpmouse(Vector2())" seems to be constrained to the game window and I want to use the mouse outside the game (on my desktop etc.)

How do I set mouse position outside my game? (preferably in GDScript, but Godot's C++ will also do)

Godot version 3.2.3
in Engine by (62 points)

2 Answers

+1 vote
Best answer

Apparently you can do this using Godot C++, but that seems to only work on Windows and it's also a lot harder to set up than the later option. I recommend using C# with this post's answer.

by (62 points)
0 votes

I don't know if you can do that because then you could make a virus that moves your mouse and stuff just with Godot. If you said that you can move it anywhere in the game window, try making your game fullscreen. That's all I got.

by (77 points)

I will not be making my project fullscreen, because the project is supposed to run in the background minimized and make my mouse move on my Desktop, in Osu!, Aseprite, etc.

I have used a C++ autoclicker and it has been able to move my mouse freely so I'm pretty sure Godot's C++ can also do it. (Or does Godot limit C++ usage somehow?)

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.