Trap Mouse

Find quick help here to get you started with Hollywood
Post Reply
oceanarts
Posts: 111
Joined: Mon May 27, 2024 10:42 pm

Trap Mouse

Post 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.
Development System : Imac G5, MorphOs 3.19
plouf
Posts: 666
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: Trap Mouse

Post 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
Christos
oceanarts
Posts: 111
Joined: Mon May 27, 2024 10:42 pm

Re: Trap Mouse

Post 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.
Development System : Imac G5, MorphOs 3.19
oceanarts
Posts: 111
Joined: Mon May 27, 2024 10:42 pm

Re: Trap Mouse

Post 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.
Development System : Imac G5, MorphOs 3.19
oceanarts
Posts: 111
Joined: Mon May 27, 2024 10:42 pm

Re: Trap Mouse

Post 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.
Development System : Imac G5, MorphOs 3.19
oceanarts
Posts: 111
Joined: Mon May 27, 2024 10:42 pm

Re: Trap Mouse

Post by oceanarts »

Didn't know I had to check "Fullscreen" in the GUI to get fullscreen working.
Sorry for the confusion.
Development System : Imac G5, MorphOs 3.19
Post Reply