Jump to content

Any Mouse Move Function?


Recommended Posts

In some Program/game make the mouse alway in the middle of the screen ex.Call Of Duty.

My Question Is: Is there any function to move the mouse like ex.MoveMouse(x,y,s)

x=move mouse x axis to any value ex.mousemove(50,0,0) my mouse will move 50 pixel right

y=move mouse y axis to any value ex.mousemove(0,-50,0) my mouse will move 50 pixel down

s=mouse speed from 0 to 100 ex.mousemove(50,-50,0) my mouse will move 50 pixel down and 50 pixel right instantly

Link to comment
Share on other sites

No There Is No Such Function But You Can Easily Write Your Own With The Combination Of Two Very Simple Functions. To Know Which Functions I Mean Please RTFM.

Edited by monoceres

Broken link? PM me and I'll send you the file!

Link to comment
Share on other sites

MouseGetPos to get current coords, MouseMove to move cursor on new coords.

In single funciton this would be like:

Mouse(100,100)
Exit

Func Mouse($x, $y,$speed=10)
    $pos=MouseGetPos()
    MouseMove($pos[0]+$x,$pos[1]+$y,$speed)
EndFunc

But I am not sure how it would work in full screen DirectX app like shooter.

Edited by Rarst
Link to comment
Share on other sites

No There Is No Such Function But You Can Easily Write Your Own With The Combination Of Two Very Simple Functions. To Know Which Functions I Mean Please RTFM.

Thank For The Idea But Could You Tell The 2 Function

I Could Only Think Of MouseGetPos And MouseMove

But That Won't Work, as I said some program/game like "call of duty" stick your mouse to the center

so MouseMove won't work

Edited by aSigN
Link to comment
Share on other sites

MouseGetPos to get current coords, MouseMove to move cursor on new coords.

In single funciton this would be like:

Mouse(100,100)
Exit

Func Mouse($x, $y,$speed=10)
    $pos=MouseGetPos()
    MouseMove($pos[0]+$x,$pos[1]+$y,$speed)
EndFunc

But I am not sure how it would work in full screen DirectX app like shooter.

That Work But Not In The Shooter Game

If I Did

Mouse(100,0,1)
Exit

Func Mouse($x, $y,$speed=10)
    $pos=MouseGetPos()
    MouseMove($pos[0]+$x,$pos[1]+$y,$speed)
EndFunc

in the game my mouse would just turn right all the time

Edited by aSigN
Link to comment
Share on other sites

Stop talking with capital letters on every word. It makes you look stupid Remember to only bump your post once in a 24 hour period (24 hours after your last post).

Also I'm pretty sure this has been answered before, so search for it.

Cheers,

Brett

EDIT: Clarified.

Edited by BrettF
Link to comment
Share on other sites

If you are making mouse cursor move right 100px, isn't is supposed to turn right? It is bit unclear - had you tried this and it fails (if so in what way?) or just assuming?

Sorry Right I mean is right that it's opposite of Left
Link to comment
Share on other sites

Stop talking with capital letters on every word. It makes you look stupid Remember to only bump your post once in a 24 hour period (24 hours after your last post).

Also I'm pretty sure this has been answered before, so search for it.

Cheers,

Brett

EDIT: Clarified.

Stop talking with capital letters on every word//Well I Have Problem With my Computer
Link to comment
Share on other sites

Sorry Right I mean is right that it's opposite of Left

Lost me here. Moving cursor 100px on horizontal axis is moving right. To move left it would be -100px on horizontal axis.

So your game moves screen differently to how funciton moves your cursor? I know 1st person games can have vertical axis reversed, but moving left/right is usually just that.

Link to comment
Share on other sites

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...