简体   繁体   English

如何禁用.NET中的特定按键?

[英]How to disable a particular key press in .NET?

我想禁用.NET(VB.NET和C#.NET)中的特定按键。

You can disable a key globally (for all applications) by writing a Global Key Hook , or just within your application using a Local Key Hook . 您可以通过编写全局密钥挂钩全局禁用密钥(对于所有应用程序),也可以仅在应用程序内部使用本地密钥挂钩禁用密钥。

Once you have hooked the incoming keys, you can ignore particular ones and not pass them on to windows / to the application. 一旦钩住了传入密钥,就可以忽略特定的密钥,而不必将其传递给Windows /应用程序。

如果只想为自己的应用程序禁用,则还可以使用IMessageFilter

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM