Jump to content

Problem with _WinAPI_Mouse_Event


Recommended Posts

I write following script:

#include<Constants.au3>
#Include<WinAPI.au3>
While 1
    HotKeySet("{PAUSE}", "MOUSE")
WEnd
Func MOUSE()
    _WinAPI_Mouse_Event($MOUSEEVENTF_MOVE, 100, 0, 0, 0)
EndFunc

This script should moves mouse cursor 100 pixels to right but it doesn't work. Cursor moves 155 pixels to right. 55 pixels too much. :/

I don't know why?

I use Windows 7 64bit. Help me, please.

Edited by Meli90
Link to comment
Share on other sites

Try

#include<Constants.au3>
#Include<WinAPI.au3>
While 1
    HotKeySet("{PAUSE}", "MOUSE")
WEnd
Func MOUSE()
    _WinAPI_Mouse_Event(BitAND($MOUSEEVENTF_ABSOLUTE, $MOUSEEVENTF_MOVE), 100, 0, 0, 0)
EndFunc

Or try a BitOR

I must mention though, I never had much luck with these functions when I tried them.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

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...