3703|5

76

帖子

0

TA的资源

一粒金砂(初级)

楼主
 

鼠标指针的刷新问题 [复制链接]

加了USB鼠标,能够显示鼠标指针。只移动鼠标,显示正常。点击鼠标时,不论左右键,鼠标指针背景就不对了,看起来是上一帧的图案。在右键菜单上下移动鼠标就会留下一行轨迹。
平时移动鼠标,没有异常,那么显示驱动里SetPointerShape应该是对的吧。
哪位大侠指点一下。多谢。

最新回复

感觉还是SetPointerShape和MovePointer出问题的可能性比较大.  详情 回复 发表于 2009-11-21 21:26
点赞 关注

回复
举报

67

帖子

0

TA的资源

一粒金砂(初级)

沙发
 
周末人气低,帮你顶了
 
 

回复

82

帖子

0

TA的资源

一粒金砂(初级)

板凳
 
看现象应该是Enable/disable Pointer时的处理不对。
 
 
 

回复

79

帖子

0

TA的资源

一粒金砂(初级)

4
 
PS/2的鼠标与键盘是一样的,都是向GWES发送一个消息
键盘:KEYBD_Event

鼠标:mouse_event
GWES接到这消息后,会根据映射表解析其具体意思,
能移动鼠标,说明驱动与GWES能通信,只是通信的内容与设想的不一致,也就是说明:驱动向GWES传送的东西(扫描码)不对,点左键时,变成了别的值。。。
mouse_event消息结构如下:
VOID mouse_event( DWORD dwFlags,
    DWORD dx,
    DWORD dy,
    DWORD dwData,
    ULONG_PTR dwExtraInfo
);
很可能是得到的x\y值不对,。。。
 
 
 

回复

59

帖子

0

TA的资源

一粒金砂(初级)

5
 
VS帮助文档:
The mouse_event function synthesizes mouse motion and button clicks.

Windows NT/2000/XP: This function has been superseded. Use SendInput instead.

Syntax


VOID mouse_event(          DWORD dwFlags,
    DWORD dx,
    DWORD dy,
    DWORD dwData,
    ULONG_PTR dwExtraInfo
);
Parameters

dwFlags
[in] Specifies various aspects of mouse motion and button clicking. This parameter can be certain combinations of the following values.
The values that specify mouse button status are set to indicate changes in status, not ongoing conditions. For example, if the left mouse button is pressed and held down, MOUSEEVENTF_LEFTDOWN is set when the left button is first pressed, but not for subsequent motions. Similarly, MOUSEEVENTF_LEFTUP is set only when the button is first released.

You cannot specify both MOUSEEVENTF_WHEEL and either MOUSEEVENTF_XDOWN or MOUSEEVENTF_XUP simultaneously in the dwFlags parameter, because they both require use of the dwData field.

MOUSEEVENTF_ABSOLUTE
Specifies that the dx and dy parameters contain normalized absolute coordinates. If not set, those parameters contain relative data: the change in position since the last reported position. This flag can be set, or not set, regardless of what kind of mouse or mouse-like device, if any, is connected to the system. For further information about relative mouse motion, see the following Remarks section.
MOUSEEVENTF_MOVE
Specifies that movement occurred.
MOUSEEVENTF_LEFTDOWN
Specifies that the left button is down.
MOUSEEVENTF_LEFTUP
Specifies that the left button is up.
MOUSEEVENTF_RIGHTDOWN
Specifies that the right button is down.
MOUSEEVENTF_RIGHTUP
Specifies that the right button is up.
MOUSEEVENTF_MIDDLEDOWN
Specifies that the middle button is down.
MOUSEEVENTF_MIDDLEUP
Specifies that the middle button is up.
MOUSEEVENTF_WHEEL
Windows NT/2000/XP: Specifies that the wheel has been moved, if the mouse has a wheel. The amount of movement is specified in dwData
MOUSEEVENTF_XDOWN
Windows 2000/XP: Specifies that an X button was pressed.
MOUSEEVENTF_XUP
Windows 2000/XP: Specifies that an X button was released.
dx
[in] Specifies the mouse's absolute position along the x-axis or its amount of motion since the last mouse event was generated, depending on the setting of MOUSEEVENTF_ABSOLUTE. Absolute data is specified as the mouse's actual x-coordinate; relative data is specified as the number of mickeys moved. A mickey is the amount that a mouse has to move for it to report that it has moved.
dy
[in] Specifies the mouse's absolute position along the y-axis or its amount of motion since the last mouse event was generated, depending on the setting of MOUSEEVENTF_ABSOLUTE. Absolute data is specified as the mouse's actual y-coordinate; relative data is specified as the number of mickeys moved.
dwData
[in] If dwFlags contains MOUSEEVENTF_WHEEL, then dwData specifies the amount of wheel movement. A positive value indicates that the wheel was rotated forward, away from the user; a negative value indicates that the wheel was rotated backward, toward the user. One wheel click is defined as WHEEL_DELTA, which is 120.
If dwFlags contains MOUSEEVENTF_HWHEEL, then dwData specifies the amount of wheel movement. A positive value indicates that the wheel was rotated to the right; a negative value indicates that the wheel was rotated to the left. One wheel click is defined as WHEEL_DELTA, which is 120.

Windows 2000/XP: If dwFlags contains MOUSEEVENTF_XDOWN or MOUSEEVENTF_XUP, then dwData specifies which X buttons were pressed or released. This value may be any combination of the following flags.

If dwFlags is not MOUSEEVENTF_WHEEL, MOUSEEVENTF_XDOWN, or MOUSEEVENTF_XUP, then dwData should be zero.

XBUTTON1
Set if the first X button was pressed or released.
XBUTTON2
Set if the second X button was pressed or released.
dwExtraInfo
[in] Specifies an additional value associated with the mouse event. An application calls GetMessageExtraInfo to obtain this extra information.
Return Value


This function has no return value.

Remarks

If the mouse has moved, indicated by MOUSEEVENTF_MOVE being set, dx and dy hold information about that motion. The information is specified as absolute or relative integer values.

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.

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).

Relative mouse motion is subject to the settings for mouse speed and acceleration level. An end user sets these values using the Mouse application in Control Panel. An application obtains and sets these values with the SystemParametersInfo function.

The system applies two tests to the specified relative mouse motion when applying acceleration. If the specified distance along either the x or y axis is greater than the first mouse threshold value, and the mouse acceleration level is not zero, the operating system doubles the distance. If the specified distance along either the x- or y-axis is greater than the second mouse threshold value, and the mouse acceleration level is equal to two, the operating system doubles the distance that resulted from applying the first threshold test. It is thus possible for the operating system to multiply relatively-specified mouse motion along the x- or y-axis by up to four times.

Once acceleration has been applied, the system scales the resultant value by the desired mouse speed. Mouse speed can range from 1 (slowest) to 20 (fastest) and represents how much the pointer moves based on the distance the mouse moves. The default value is 10, which results in no additional modification to the mouse motion.

The mouse_event function is used to synthesize mouse events by applications that need to do so. It is also used by applications that need to obtain more information from the mouse than its position and button state. For example, if a tablet manufacturer wants to pass pen-based information to its own applications, it can write a DLL that communicates directly to the tablet hardware, obtains the extra information, and saves it in a queue. The DLL then calls mouse_event with the standard button and x/y position data, along with, in the dwExtraInfo parameter, some pointer or index to the queued extra information. When the application needs the extra information, it calls the DLL with the pointer or index stored in dwExtraInfo, and the DLL returns the extra information.
 
 
 

回复

99

帖子

0

TA的资源

一粒金砂(初级)

6
 
感觉还是SetPointerShape和MovePointer出问题的可能性比较大.
 
 
 

回复
您需要登录后才可以回帖 登录 | 注册

随便看看
查找数据手册?

EEWorld Datasheet 技术支持

相关文章 更多>>
关闭
站长推荐上一条 1/7 下一条

 
EEWorld订阅号

 
EEWorld服务号

 
汽车开发圈

About Us 关于我们 客户服务 联系方式 器件索引 网站地图 最新更新 手机版

站点相关: 国产芯 安防电子 汽车电子 手机便携 工业控制 家用电子 医疗电子 测试测量 网络通信 物联网

北京市海淀区中关村大街18号B座15层1530室 电话:(010)82350740 邮编:100190

电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2025 EEWORLD.com.cn, Inc. All rights reserved
快速回复 返回顶部 返回列表