News:

Building a 3D Ray Tracer  By stevmjon

Main Menu

SetMouse offset?

Started by stevmjon, October 04, 2022, 07:28:14 PM

Previous topic - Next topic

stevmjon

i am not sure if SetMouse on my computer is 'normal'.

when i re-position the screen to x=0 , y=0 there is an offset x on my monitor (see pic).
to get the screen to the very edge i need to use x = -8 .

i also notice that when i turn the mouse off / then on again using SetMouse, i need to put an offset x (allow for the gap on left of my window) and y (allow for titlebar height) to get the pointer in the same position.
i always take into account the screen position when using SetMouse.

thought i would post if anybody else is getting this window offset x from their monitor too.

   stevmjon
It's easy to start a program, but harder to finish it...

I think that means i am getting old and get side tracked too easy.

kevin


  Same offset thing occurs here.  Even though GetWindowRect returns that the window is located at zero zero.     They do apply offsets though for effect stuff these days to windows. 

stevmjon

thanks kev, so it's normal. i thought it was my monitor or something.

i have figured out how to detect this 'offset' value, so can set down the mouse in it's original location, even if the user moves the screen location by grabbing the titlebar then moving screen around desktop.

what i am not sure about is how to measure pixel width (i assume this is correct, or maybe a ratio value) when somebody manually stretches the screen, so it's size is bigger/smaller. i noticed the stretched/shrunk pixel location inside the screen is still within width & height of the OpenScreen command.
so the mouse position seems to be correct inside a stretched screen, but using SetMouse in this screen i am not sure about how to get it to the correct original location...

   any advice is appreciated, stevmjon
It's easy to start a program, but harder to finish it...

I think that means i am getting old and get side tracked too easy.