简体   繁体   English

如何在C#中的单击事件中找出正在按下的键?

[英]How can i find out what key is being pressed in a click event in C#?

I am trying to see if a key or a modifier such as ALT,CTRL,etc is being pressed inside a Cell-Double-Click Event (or possibly any other events rather than key based events such as Key_Up or Key_Down etc). 我试图看看是否在单元格双击事件(或可能是任何其他事件而不是基于键的事件,如Key_Up或Key_Down等)中按下了键或修饰符(如ALT,CTRL等)。 How can i achieve this in C#? 我怎样才能在C#中实现这一目标?

如果引用System.Windows.Input则可以查看以下内容

if (Keyboard.Modifiers == ModifierKeys.Shift)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 当在c#winform中按下PageDown键时,如何触发Button Click事件 - How can I fire a Button Click event when PageDown key pressed in c# winform C#中的Keypress事件以找出按下的键 - Keypress event in c# to find out the pressed key 当基于具有焦点的文本框按下Enter键时,如何触发Button Click事件? - How can I fire a Button Click event when Enter Key is pressed based on what textbox has focus? 如何处理C#中另一个按键单击事件中按下的按键 - how to handle the key pressed inside another key click event in c# C#:如何在文本框的 keydown 事件中禁止按键被无限按下? - C#: How do you disable a key from being pressed indefinetly in textbox's keydown event? 你如何找到在C#中订阅活动的内容? - How do you find out what is subscribed to an event in C#? C#-我需要弄清楚如何使GUI监听IF语句中被按下的按钮 - C# - I need to figure out how to make GUI that listens for buttons being pressed in a IF statement 如何检查键是否被多次点击或找出一个键被按下了多长时间 c# - How to check if key has been clicked more than once or to find out how long a key has been pressed for c# 用C#更改按下的键 - Change the key being pressed with C# 在WPF C#中按下TAB键时如何触发事件? - how to fire an event when the TAB key is pressed in wpf c#?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM