User Tag List

Results 1 to 5 of 5

Thread: How to lock mouse in window without mousemovement?

  1. #1
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export ModuleInstall Creator Pro

    Join Date
    Jul 2006
    Location
    Germany
    Posts
    1,090
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to lock mouse in window without mousemovement?

    Is this possible? I created a custom mouse movement using the "Mouse Object" extension, so I can't use MMF's built-in mouse movement to hold the mouse within the window.

    Instead, I check if the mouse gets close to the window borders and set it's position back to (Border-80 pixels). That works, but not perfect. If the player moves the mouse very fast and clicks at the wrong moment, then the mouse will slip out of the window for a fraction of a second. If, for example, the windows explorer lies under the game window, the player could drag and drop a folder without even noticing it. To prevent this, I have set the window maximized.

    But I'd be glad if there's a better way to tame the mouse

  2. #2
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to lock mouse in window without mousemovem

    It's never a good idea to lock the mouse to a window, it annoys people if they can't get out easily (to click on a chat window and talk to their mate for example).

    Generally games compromise by making the mouse return to normal if you pause the game, and make the game really easy to pause (eg the escape key).

    I don't have any ideas about how to lock the mouse to the window using the mouse object (I assume you're changing the cursor?) but a common technique is to hide the mouse, record the amount of mouse movement from one frame to the next and add that to the position of an active, then move the mouse to the centre of the window. This means it would only be possible to have the mouse escape the window if the player could move it faster than the width of your window in one frame.

  3. #3
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export ModuleInstall Creator Pro

    Join Date
    Jul 2006
    Location
    Germany
    Posts
    1,090
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to lock mouse in window without mousemovem

    The player sprite is stuck to the mouse pointer, while the mouse itself is invisible, so I can't record the distance only.

    Of course, you can pause the game easily by pressing any key. While the game is paused, the mouse becomes visible again and is no longer limited to the window. The game also enters paused mode automatically if it's window loses focus, just in case the player uses Alt-Tab or something like this.

  4. #4
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jun 2006
    Location
    England
    Posts
    3,546
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)

    Re: How to lock mouse in window without mousemovem

    The Sphax Kernel object for MMF2 Developer has a confine mouse action.
    .:::.Joshtek.:::.

  5. #5
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export ModuleInstall Creator Pro

    Join Date
    Jul 2006
    Location
    Germany
    Posts
    1,090
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to lock mouse in window without mousemovem

    Sounds interesting, I'll take a look, thanks!

Similar Threads

  1. Replies: 4
    Last Post: 24th April 2014, 08:25 AM
  2. how switch on the led (caps lock, scroll lock, num lock) in the keyboard??
    By daniele in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 24th April 2012, 12:09 AM
  3. Is there a way to lock another window?
    By RGBreality in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 3rd June 2010, 11:30 PM
  4. Mouse Out Of Window?
    By Atom in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 16th August 2009, 10:50 AM
  5. Move Window to Mouse
    By GabSt in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 14th July 2008, 05:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •