You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The y position in with a mouse event is not relative to the window but absolute to screen buffer. This means that when the mouse cursor is at top left it will be x: 0, y: 2295 (y = number of cells counting from the top of the buffer) instead of 0,0 to the window.
As you can see the cursor is at: x: 0, y: 2858, although I have the mouse at the top left. We can calculate the relative cursor position very easily. With winapi you can request the current window positions, this structure contains the top, left, bottom, right properties of were the window is in the screen buffer.
The text was updated successfully, but these errors were encountered:
TimonPost
changed the title
mouse input y position is absolute not relative to screen
mouse input y position is absolute not relative to screen winapi
Oct 20, 2019
TimonPost
changed the title
mouse input y position is absolute not relative to screen winapi
mouse input x, y is absolute not relative to window winapi
Oct 20, 2019
The y position in with a mouse event is not relative to the window but absolute to screen buffer. This means that when the mouse cursor is at top left it will be x: 0, y: 2295 (y = number of cells counting from the top of the buffer) instead of 0,0 to the window.
As you can see the cursor is at:
x: 0, y: 2858
, although I have the mouse at the top left. We can calculate the relative cursor position very easily. With winapi you can request the current window positions, this structure contains the top, left, bottom, right properties of were the window is in the screen buffer.We can calculate the absolute with the following:
The text was updated successfully, but these errors were encountered: