mouse_event和绝对坐标

本文详细解析了在Windows环境下使用mouse_event函数时,如何处理绝对与相对坐标输入。当使用绝对坐标时,dx和dy参数表示的是显示器表面上0到65535范围内的坐标值;而相对坐标则表示相对于上一次鼠标事件位置的偏移量。

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值