Page 1 of 1
Trap Mouse
Posted: Mon May 27, 2024 11:14 pm
by oceanarts
Hi!
Is there a way to restrict the mouse movement to a certain area inside the current (windowed) display?
I can't seem to figure it out.
Re: Trap Mouse
Posted: Mon May 27, 2024 11:30 pm
by plouf
check mouse position and if outside
move it with
MovePointer()
dont forget to give a way to user to abort it, since it may be annoying/abuse use
Re: Trap Mouse
Posted: Tue May 28, 2024 12:19 am
by oceanarts
I am trying to replicate an "It Came From The Desert" style first person shooting scene. I've replaced the mouse pointer with a reticle and it's rather annoying when the cursor leaves the window. I think it would bug any player as well.
My Fedora Linux doesn't seem to want to listen to the movepointer command, and I can't get the fullscreen mode to work either.
EDIT: Yes, I just checked in FS_UAE. It works more or less as it should on Workbench. I can center the cursor, and restrict it's movement to a degree. It moves outside the window if I move the mouse super fast though.
On Fedora the movepointer command has no effect.
Re: Trap Mouse
Posted: Tue May 28, 2024 12:55 am
by oceanarts
It occurred to me that it might be a Wayland issue. That seems to be the case.
Logging in with Xorg seems to remedy the issue.
Re: Trap Mouse
Posted: Tue May 28, 2024 2:27 pm
by oceanarts
I would assume this would potentially cause problems on certain target platforms, since Wayland is quickly becoming the standard display server at least for the two most popular Desktops on Linux, KDE and Gnome.
Re: Trap Mouse
Posted: Tue May 28, 2024 6:22 pm
by oceanarts
Didn't know I had to check "Fullscreen" in the GUI to get fullscreen working.
Sorry for the confusion.