简体   繁体   English

如何从任何地方捕获Ctrl +鼠标滚轮?

[英]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.

相关问题 从CTRL +“东西”到带有代码示例的字符串 - From CTRL+“something” to a string with a code sample 如何在Win表单应用程序中检测两个热键,例如CTRL + C,CTRL + W - how to detect two hot key in win form app like CTRL +C , CTRL+ W 如何将Ctrl +(控制键和逗号)作为WPF菜单项的键盘快捷键? - How to assign Ctrl+, (control plus comma) as the keyboard shortcut to a WPF menu item? 当我们使用ctrl +鼠标左键单击wpf时如何取消选择devexpress数据网格行 - how to unselect a devexpress data grid row when we click with ctrl+ mouse left button wpf 使用ctrl + mousewheel更改ListView的fontSize - Change fontSize of ListView with ctrl + mousewheel 用于 CTRL+C 和 CTRL+V 手势的键绑定不起作用? - KeyBinding for gestures CTRL+C and CTRL+ V do not work? 如何重组/设计以下自定义Cmdlet的代码? 在调用堆栈中,从任何地方知道执行的cmd? - How to restructure/design the following code of custom Cmdlet? Within callstack, from any place to know the executing cmd? 获取在Ctrl + C操作后复制到变量的数据 - Get the data copied after Ctrl+ C operation to a variable 在UserControl中按CTRL + N键,将焦点对准AutoCompleteBox - Focus into AutoCompleteBox on CTRL+ N key pressed in UserControl 为什么按Ctrl +“+”会在TextBox中产生哔声? - Why does pressing Ctrl+“+” produce a beep in a TextBox?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM