Jump to content
Sign in to follow this  
philkryder

Mouse Moves When it shouldn't

Recommended Posts

I'm guessing that this has broken "for a long time."

Just to clarify my hardware setup for future readers. I have four displays numbered 1,2,3,4 from left to right

#4 is my "main display" - it is in Landscape orientation at 1024x1280
#3 is in Landscape  at 1920x1200 
#2 is in Landscape also at 1920x1200
#1 is in PORTRAIT at 1280x1024

The #4 display is "lined up" with the bottom of the #3 display.
That means that there are negative $y values at the top on all three of screens 1,2,3 

Phil

here is the AutoIT info:

>"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "R:\Operations\MacroTools\AutoIT\keepWindowUnlocked\multipleGetPos.au3" /UserParams    
+>12:20:39 Starting AutoIt3Wrapper v.15.920.938.0 SciTE v.3.6.0.0   Keyboard:00010409  OS:WIN_7/Service Pack 1  CPU:X64 OS:X64    Environment(Language:0409)
+>         SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE   UserDir => C:\Users\Pkryder\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper   SCITE_USERHOME => C:\Users\Pkryder\AppData\Local\AutoIt v3\SciTE 
>Running AU3Check (3.3.12.0)  from:C:\Program Files (x86)\AutoIt3  input:R:\Operations\MacroTools\AutoIT\keepWindowUnlocked\multipleGetPos.au3
+>12:20:39 AU3Check ended.rc:0
>Running:(3.3.12.0):C:\Program Files (x86)\AutoIt3\autoit3.exe "R:\Operations\MacroTools\AutoIT\keepWindowUnlocked\multipleGetPos.au3"    
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop

 

Edited by philkryder

Share this post


Link to post
Share on other sites

so, I set up this code to march to the far upper left of the left most screen.
 

Local $x = MouseGetPos(0)
Local $y = MouseGetPos(1)

While(True)

    MouseMove($x,$y,0)

    Sleep (2500) ;(3*60*100) ; sleep 3 minutes

    $x = MouseGetPos(0)-2
    $y = MouseGetPos(1)-2



Consolewrite(@CR & "x  >" & $x & "<   y>" & $y & "<")

WEnd

It got to here and then stopped moving.
x  >-4866<   y>-178<
x  >-4866<   y>-178<
x  >-4866<   y>-178<
x  >-4866<   y>-178<
x  >-4866<   y>-178<
x  >-4866<   y>-178<

I'm calculating that my total number of $x pixels is 1024 + 1920 + 1920 + 1200 = 6064
Of which only 4864 are to the left of the main screen and should have been numbered from 0zero to -4863...
But, we get 3 additional pixels. I hate "fencepost problems."
So, I'm more confused than ever.

Similarly $y for the left most portrait display should have been 1200 - 1024 = 176 pixels numbered from 0zero to - 175..
But, I get -178.
Where did the extra 3 pixels come from in $x and $y?

 

 


 

 

 

Share this post


Link to post
Share on other sites

here's an interesting sequence. I put the mouse in the "notch" where the #3 screen is taller than the number 4.
$x counts down to -1 assumedly because it can't move to the right until $y gets down to zero...
Then when $y gets to zero, so does $x and then they stay there.
I'm had assumed Pixel 0zero,0zero was  in the right most pixel column on screen #3 and one pixel row above the top of screen #4.
But, now, I'm not so sure...

Local $x = MouseGetPos(0)
Local $y = MouseGetPos(1)

While(True)
    MouseMove($x,$y,0)

    Sleep (1500) ;(3*60*100) ; sleep 3 minutes

    $x = MouseGetPos(0)
    $y = MouseGetPos(1)

    Consolewrite(@CR & "x  >" & $x & "<   y>" & $y & "<")

WEnd

4<   y>-22<
x  >-3<   y>-21<
x  >-2<   y>-20<
x  >-1<   y>-18<
x  >-1<   y>-18<
x  >-1<   y>-17<
x  >-1<   y>-16<
x  >-1<   y>-15<
x  >-1<   y>-14<
x  >-1<   y>-13<
x  >-1<   y>-12<
x  >-1<   y>-11<
x  >-1<   y>-10<
x  >-1<   y>-9<
x  >-1<   y>-8<
x  >-1<   y>-7<
x  >-1<   y>-5<
x  >-1<   y>-4<
x  >-1<   y>-3<
x  >-1<   y>-2<
x  >-1<   y>-1<
x  >0<   y>0<
x  >0<   y>0<
x  >0<   y>0<
x  >0<   y>0<
x  >0<   y>0<

Edited by philkryder

Share this post


Link to post
Share on other sites

The right hand screen position is -1, the other end is -1920, if MouseGetPos was the problem then the mouse would move left, not right. If it's not supposed to be -1920 then MouseMove would be too far to the LEFT of the screen, yet if you feed MouseMove -1920, the mouse starts moving right.

There's no such mouse position as -0 so the screen starts at -1, where the other screen ends at 0. MouseMove isn't taking this into account. Pixel zero is on the right hand screen.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

just so I'm more clear, you are referring to screen #3 - 1920x1200 Landscape.
With $x pixels going from -1 on the right to -1920 on the left.

and therefore the right most screen (#4) which is 1200x1024 landscape 
has:
$x on that screen #4 goes from 0 to 1199?
$y on that screen #4 goes from 0 to 1023?

Am I understanding correctly?
 

Share this post


Link to post
Share on other sites

In a 2 screen set up 1920x1200, main screen is on the right, second screen is on the left.

On main screen (right), X goes from 0 to 1919, Y goes from 0 to 1919 1199

On second screen (left), X goes from -1920 to -1, Y stays the same as above.

If you have more screens to the left of the main screen, or right of the main screen, then the position will go up/down by the amount of the pixels to the left or right of those. I leave the math to you.

Edited by BrewManNH
typo corrected

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

-quote removed per suggestion below.

don't you mean Y goes from 0 to 1199?

 

Edited by philkryder
remove unneeded quote.

Share this post


Link to post
Share on other sites

Typo obviously.

BTW, no need to quote what I wrote, just use the Reply to this topic button or click in the edit box at the bottom. I know what I wrote, so it only pads the topic unnecessarily. :)

 


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

Sorry for topic digging.

I have the same issue, but it's pretty easy to find the problem.

(Displays are top aligned, main monitor is on the right)

MouseMove(0, 0) move my mouse at pos 0, 0 (top left corner of right screen)

MouseMove(-1, 0) move my mouse at pos 0, 0 (top left corner of right screen)

MouseMove(-2, 0) move my mouse at pos -1, 0 (top right corner of left screen)

 

So, i assume that it's MouseMove that didn't do it's job.

Edited by TommyDDR

_GUIRegisterMsg (Register more than 1 time the same Msg), _Resize_Window (GUICtrlSetResizing for children windows), _GUICtrlSetOnHover (Link a function when mouse go on, left, clic down, clic up, on a control), _InputHeure (Create an input for hour contain), _GUICtrlCalendar (Make a complete calendar), _GUICtrlCreateGraphic3D (Create a 3D graph), _ArrayEx.au3 (Array management), _GUIXViewEx.au3 (List/Tree View management).

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...