Daemon in C# to listen for keypress

只谈情不闲聊 提交于 2019-12-05 09:24:49

问题


I'm looking to create a small C# application that will either run as a daemon or sit in the taskbar, and wait for a specific keypress. When the expected keypress is encountered, I'll perform some actions.

This is going to be used primarily for quick-posting of data to a web-service I'm writing. I've looked around the net for a while, but my search terms have been too vague, and I haven't come across any concrete examples or guides.

Thanks,

Mike Trpcic


回答1:


I came across this on CodeProject. It'll capture keystrokes while it's not focused. CodeProject: A Simple C# Global Low Level Keyboard Hook



来源:https://stackoverflow.com/questions/1010723/daemon-in-c-sharp-to-listen-for-keypress

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!