编写键盘设备驱动程序 [英] Writing a keyboard device driver

查看:127
本文介绍了编写键盘设备驱动程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道那里是否有人有编写键盘设备驱动程序的经验.我知道键盘中断的工作原理,但实际上并不了解所有细节.它困难吗?对一个人来说太难了吗?

I was wondering if anybody out there has had experience writing keyboard device drivers. I know the basics of how keyboard interrupts work however don't really know the details of everything. Is it difficult? Too difficult for one person?

之所以这样问,是因为最近我购买了Apple键盘,而Windows驱动程序似乎无法识别很多键.另外,如果您知道一个比编写驱动程序更简单的解决方案,我也将不胜感激. (我已经尝试过SharpKeys,似乎是Windows驱动程序问题,无法识别某些扫描代码)

I ask this because recently I purchased a Apple keyboard and the windows driver doesn't seem to recognize a lot of keys. Also if you know an easier solution to solve this other than writing a driver I would appreciate that as well. (I've already tried SharpKeys, seems like it's a windows driver problem that it can't recognize certain scan codes)

推荐答案

这是编写Windows设备驱动程序所需要的:

Here is what you will need to write the device driver for Windows:

  • 对wdf驱动程序框架(KMDF)及其API的理解(我不建议使用WDM)
    • An understanding of the wdf driver framework (KMDF) and its API's (I don't recommend WDM)
      • http://msdn.microsoft.com/en-us/windows/hardware/gg463342
      • http://msdn.microsoft.com/en-us/windows/hardware/gg463311

      如果您可以找到非常相似的驱动程序或另一个平台上的驱动程序的源,则可能可行,否则...

      If you can find the source for a very similar driver or the driver on another platform this might become doable, otherwise...

      如果您对设备驱动程序感兴趣,请尝试通过编写纯软件驱动程序开始.它很可能只是一个玩具",但是您可以在内核中做一些非常整洁的工作,因此值得拥有一个玩具驱动程序.您可以使用IOCTL在用户模式.exe和驱动程序之间进行通信.也许最终您可以将其更新为仅软件的键盘仿真驱动程序,然后尝试将其升级为所需的实际键盘设备驱动程序.

      If you are interested in device drivers, try starting by writing a software-only driver. It will most likely be just a "toy", but you can do some really neat stuff in the kernel so maybe its worth having a toy driver. You can communicate between a user-mode .exe and your driver with an IOCTL. Maybe eventually you can update it into a software-only keyboard emulating driver, then try to upgrade it into the actual keyboard device driver that you want.

      找到了一个有关纯软件键盘驱动程序的线程: http://www.osronline.com/showthread.cfm?link=119885

      Found a thread about software-only keyboard drivers: http://www.osronline.com/showthread.cfm?link=119885

      也许这很有用: http://www.osronline.com/ddkx/intinput /i8042ref_9eb6.htm

      更新:Hyper-V适用于所有Windows 8用户,并且应在很大程度上消除第二台PC"的要求.您可以在VM上运行驱动程序,然后将内核调试器连接到它.

      Update: Hyper-V is available for all Windows 8 users, and should largely eliminate the "second PC" requirement. You can run your driver on a VM and connect the kernel debugger to it.

      这篇关于编写键盘设备驱动程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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