Sign in to follow this  
Followers 0
Meli90

Problem with _WinAPI_Mouse_Event

4 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

It still doesn't work.

BitAND case: cursor doesn't move.

BitOR case: cursor moves to left-up corner desktop, not 100 pixels to right side.

Share this post


Link to post
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
Sign in to follow this  
Followers 0