If MOUSEEVENTF_ABSOLUTE value is specified, dx and dy contain normalized absolute coordinates between 0 and 65,535. The event procedure maps these coordinates onto the display surface. Coordinate (0,0) maps onto the upper-left corner of the display surface, (65535,65535) maps onto the lower-right corner.
如果在调用mouse_event时指定了MOUSEEVENTF_ABSOLUTE ,dx 和 dy 就是从0到65535的绝对坐标。这个事件的作用是将坐标映射到显示器表面。(0,0)坐标对应着显示器表面的左上角,(65535,65535)坐标对应着显示器表面的右下角。
If the MOUSEEVENTF_ABSOLUTE value is not specified, dx and dy specify relative motions from when the last mouse event was generated (the last reported position). Positive values mean the mouse moved right (or down); negative values mean the mouse moved left (or up).
原文:
http://msdn.microsoft.com/en-us/library/ms646260(VS.85).aspx
本文详细解析了在Windows环境下使用mouse_event函数时,如何处理绝对与相对坐标输入。当使用绝对坐标时,dx和dy参数表示的是显示器表面上0到65535范围内的坐标值;而相对坐标则表示相对于上一次鼠标事件位置的偏移量。

1721

被折叠的 条评论
为什么被折叠?



