如何勾选&重新映射密钥 [英] How to hook & remap keys

查看:94
本文介绍了如何勾选&重新映射密钥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,我正在研究我的大学毕业项目,我需要制作一个DLL来挂钩并重新映射一些键盘键,然后才能发送到重点项目。示例:我的程序在后面运行,当我在记事本中按A来写B.



我希望有人可以帮助我:D

非常感谢Daniel!

Hello, I am working on my end-of-college project and I need to make a DLL to hook and remap some keyboard keys before they are send to the focused program. Example: my program runs in back and when I press A in notepad to write B.

I hope someone can help me :D
Thank you very much, Daniel!

推荐答案

试试看看这个页面和相关资源,来自 MSDN库



http:// msdn .microsoft.com / zh-CN / library / ms644990(VS.85).aspx [ ^ ]



我认为你需要的第一步是< b>低级键盘钩(参见 WH_KEYBOARD_LL )处理密钥,然后将它们分派到活动应用程序。



请注意,从安装的钩子程序中你只有两个选择:



Try have a look to this page and the related resources, from the MSDN library:

http://msdn.microsoft.com/en-us/library/ms644990(VS.85).aspx[^]

I think that what you need as first step is a low-level keyboard hook (see WH_KEYBOARD_LL) to process keys before that they are dispatched to the active application.

Note that from the installed hook procedure you have only two choices:



    • 避免对发送的密钥进行进一步处理
  • cal l下一个已安装的挂钩(这意味着您的应用程序对发送的密钥不执行任何操作,如果没有安装更多挂钩,则将已发送的密钥发送到活动应用程序)





然后重新映射一些键盘按键你应该做的事情如下:





Then to remap some keyboard keys what you should do is something like the following:



    • 安装你的钩子程序
  • 你的钩子程序识别不应重新映射的键盘键,并通过调用 CallNextHookEx
    处理它们
  • 避免处理应重新映射的键盘键,并将带有重映射的密钥代码的 WM_CHAR 消息发送到活动应用程序
  • avoid processing of keyboard keys that should be remapped and send a WM_CHAR message with the remapped key code to the active application


大家好我也有同样的问题。我将完成我的单身汉工作,我必须跟踪注册表项工作,然后在操作系统的过程中使用相同的逻辑。



请有人帮助我为我的项目获取此类代码。我有几次。思考并完成它。你会感谢这份工作。实际上,很难找到OS过程中的所有变化。但我必须得到它并将结果与​​timeinterval结果进行比较。
Hello everybody I have too same problem. I'm going to finish my bachelor work and i have to track the registry key work then used to use same logic in Process of OS.

Please somebody help me to get this type of code for my project. I have a few time. To think and finish it. You will be thankful for this job. Actually it's being difficult to find all of change in process of OS. But i have to get it and compare the result with timeinterval result.


这篇关于如何勾选&amp;重新映射密钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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