C#非常简单的键盘挂钩 [英] C# very simple keyboard hook

查看:70
本文介绍了C#非常简单的键盘挂钩的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在C#中创建自定义宏程序,我想知道如何创建低级键盘钩子.我环顾四周,发现了一些东西,但我不明白它们是如何工作的或如何对其进行自定义:/

任何人都可以告诉我如何创建基本上可以执行的键盘挂钩:

一旦按下任意键,则将int密钥代码设置为一种方法(我认为VK代码正是我所需要的?)

我在网上发现的言词似乎太复杂了:/

谢谢:)

解决方案

一个简单的C#全局CodeProject上的低级​​键盘钩似乎是正确的.当我搜索键盘钩"时,这是Google上的第二大热门,而当您搜索确切名称时,这是第一大热门.你试过了吗?

im trying to create a custom macro program in C# and I want to know how I can create a low level keyboard hook. I have looked around and have found some but i do not understand how they work or how i can customise it :/

can anyone show me how I can create a keyboard hook that basically does:

once any key is pressed, the int keycode is set to a method (i think the VK code is what i need?)

the exampels i find online seem too complicated for that :/

Thanks :)

解决方案

A Simple C# Global Low Level Keyboard Hook on CodeProject seems about right. It was the second hit on Google when I searched for 'keyboard hook' and the first when I searched for your exact title. Have you tried it?

这篇关于C#非常简单的键盘挂钩的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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