[英]How to catch a Ctrl+ mousewheel from any place of code?
There is a RawViewControl (I have no access to its code) that is placed on ViewDoc control - ViewDoc is a container for it. 在ViewDoc控件上放置了一个RawViewControl(我无法访问其代码)-ViewDoc是它的容器。 I am trying to handle mousewheel event but RawViewControl has no such event and if I handle mousewheel event of ViewDoc it have not fires (this is right - the focus is on the RawViewControl). 我正在尝试处理鼠标滚轮事件,但RawViewControl没有此类事件,如果我处理ViewDoc的鼠标滚轮事件,则不会触发(这是正确的-焦点在RawViewControl上)。 How could I catch this event from ViewDoc class? 如何从ViewDoc类中捕获此事件?
I'm not sure if I understand your question correctly, but one way I handle any ctrl + something
movement is, OnKeyDown
I check to see if the key ctrl
has been clicked. 我不确定我是否正确理解了您的问题,但是我处理任何ctrl + something
动作的一种方法是OnKeyDown
我检查是否已单击关键ctrl
。 If it has I set a global variable to g_IsCtrlDownTrue = true
. 如果有,我将全局变量设置为g_IsCtrlDownTrue = true
。 OnKeyUp
sets it back to false. OnKeyUp
将其设置回false。 Then, on your mouse scroll check to see if ctrl
is down, and if it is perform your ctrl + mouse
movement. 然后,在您的鼠标滚动上查看ctrl
是否按下,以及是否执行ctrl + mouse
移动。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.