简体   繁体   中英

C# very simple keyboard hook

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?

我在此处编写了有关代码项目的RAW INPUT示例,这可能对您有所帮助。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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