为 Windows 7 桌面开发我自己的虚拟键盘
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6472563/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Developing my own virtual keyboard for Windows 7 Desktop
提问by
I would like to build my own virtual keyboard for my windows 7 tablet. I am not starting from zero in programming; I just have no idea on where to start to make a system level device like a virtual keyboard.
我想为我的 Windows 7 平板电脑构建我自己的虚拟键盘。我不是从零开始编程;我只是不知道从哪里开始制作像虚拟键盘这样的系统级设备。
Is there a good article or SDK for this?
有没有好的文章或SDK?
采纳答案by Stephen Cleary
You'll need to write a driver in order to truly get a virtual keyboard. Keyboard drivers cannot be written in C#.
您需要编写驱动程序才能真正获得虚拟键盘。键盘驱动程序不能用 C# 编写。
Drivers are written in C (not even C++; just C), and they use the Windows Driver Kitfor development. There is insufficient documentation, period (the sooner you admit this, the better). Pick up a copy of the following books if you don't already have them: Windows Internals, Advanced Windows Debugging, Oney's Programming the Windows Driver Model, and Developing Drivers with the Windows Driver Foundation. I strongly recommend using KMDF, since it makes writing drivers only extremely difficult rather than insanely near-impossible. Subscribe to OSR's NTInsiderand read their mailing list archives (they are the only source I know that has all the missing details on driver writing). Begin working your personal contacts because there's a medium-to-high chance you'll need to talk to someone deep within Microsoft.
驱动程序是用 C 编写的(甚至不是 C++;只是 C),并且它们使用Windows 驱动程序工具包进行开发。没有足够的文件,期限(你越早承认这一点越好)。如果您还没有以下书籍,请选择以下书籍的副本:Windows Internals、Advanced Windows Debugging、Oney 的Windows Driver Model 编程和使用 Windows Driver Foundation 开发驱动程序。我强烈建议使用KMDF,因为它使编写驱动程序变得非常困难,而不是几乎不可能。订阅OSR 的 NTInsider并阅读他们的邮件列表档案(他们是我所知道的唯一包含有关驱动程序编写的所有缺失细节的来源)。开始处理您的个人联系人,因为您很有可能需要与 Microsoft 内部的某个人交谈。
To be brutally honest, it is a lot easier to hire an existing expert in the field. Driver development is notcheap, but it's cheaper than doing it yourself.
老实说,聘请该领域的现有专家要容易得多。驱动开发并不便宜,但比自己做要便宜。
回答by Brandon Boone
Here's an old C++ article on the matter.
这是一篇关于这个问题的旧 C++ 文章。
But I think you'll wind up using SendKeys in C# - http://www.codeproject.com/KB/cs/SendKeys.aspx
但我认为你最终会在 C# 中使用 SendKeys - http://www.codeproject.com/KB/cs/SendKeys.aspx