scrcpy icon indicating copy to clipboard operation
scrcpy copied to clipboard

Background mouse click offset

Open xxdoc opened this issue 2 years ago • 0 comments

  • [ ] I have checked that a similar feature request does not already exist.

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like A clear and concise description of what you want to happen.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

left_down(handle: HWND, x: int, y: int): ""

Args:
    handle (HWND): 
    x (int): 
    y (int): 
"""
# https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-lbuttondown
wparam = 0
lparam = y << 16 | x
PostMessageW(handle, WM_LBUTTONDOWN, wparam, lparam)

left_up(handle: HWND, x: int, y: int): ""

Args:
    handle (HWND): 
    x (int): 
    y (int): 
"""
# https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-lbuttonup
wparam = 0
lparam = y << 16 | x
PostMessageW(handle, WM_LBUTTONUP, wparam, lparam)

I used do left_down hwnd,100,100 left_up hwnd,100,100 sleep 100 loop

I click the coordinate points in the screen through the API loop. If the mouse position is in the image of scrcpy, the clicked coordinates are not offset. If you move the mouse to other programs, you can observe that the mouse click points displayed in scrcpy will not always be at the coordinates of 100,100, and there will be an offset with the change of mouse position. Can this be avoided?

xxdoc avatar Jun 19 '22 01:06 xxdoc