当您按下鼠标左键并移动鼠标时,如果停止移动会发生什么事件? [英] when u press left click and move mouse, what event be happend if stop moving?

查看:47
本文介绍了当您按下鼠标左键并移动鼠标时,如果停止移动会发生什么事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨.我想设计绘画软件.当按左键单击并移动鼠标时,如果也按了停止键并单击左键,会发生什么事件.请指导我.谢谢

解决方案

请参阅我对问题的评论.

...当然,没有任何与运动的停止"相对应的事件;并且此类事件原则上不存在.出于非常非常简单的原因:鼠标事件是由硬件驱动程序生成的,并且没有与运动的停止"相关的硬件中断,并且这种中断不存在.反过来,这是非常非常简单的原因:对于这样的事件,不可能有一个良好"的标准.这只是在一定时间内缺少事件.

不仅认为这样甚至可以存在,而且这种便利的真正愿望是巨大的误解.即使您有类似的东西,也确实无法使用.原则上,您可以使用计时器来模拟类似于此类行为的内容.您可以创建一个事件,如果在某些时间段内都没有鼠标(如果按下了某些鼠标按钮),则由计时器事件处理程序调用该事件(请再次查看我对问题的评论).现在,想象一下用户将经历的噩梦...

—SA


hi. i want to design the paint software. when press left click and move mouse, what event happen if stop move and left click be pressed too.please guide me.thanks

解决方案

Please see my comment to the question.

...and of course, there is no any event corresponding to the "stop" of the motion; and such event cannot exist in principle. By a very, very simple reason: mouse events are generated by a hardware driver, and there is no a hardware interrupt related to "stop" of the motion, and such interrupt cannot exist. And, in turn, this is so by a very, very simple reason: there cannot be a "good" criterion for such an event. This is just the lack of events for certain period of time.

Not just thinking that such even can exist, but the very desire of such facility is a huge misconception. Even if you had something similar, it would be really unusable. In principle, you could simulate something resembling such behavior using a timer. You could create an event invoked (please see my comment to the question again) by the timer event handler in case of absence of mouse even for certain period of time, if some mouse button is pressed. And now, imagine the nightmare the user would experience...

—SA


这篇关于当您按下鼠标左键并移动鼠标时,如果停止移动会发生什么事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆