GetAsyncKeyState 匹配后取消击键?

发布于 2024-09-06 01:36:12 字数 401 浏览 1 评论 0原文

我正在为我的岳母创建一个实用程序,以便将 CTRL-C 和 CTRL-V 命令重新映射到她键盘上的一个信号按钮,以协助完成家庭作业。第一次按下时,它将提交一个 COPY 命令。下一次按下将是 PASTE 命令。由于我的小应用程序不会成为焦点,因此我需要使用 GetAsyncKeyState。现在我正在尝试将这一切映射到波浪号键。如何取消波浪号键实际传递到所选字段并覆盖数据或将其自身附加到粘贴的文本?可以在任何 .NET 框架中使用 C#,也可以在这个小小程序中使用 VB6。

我知道我正在寻找的答案可能有助于创建恶意软件,因此如果有人觉得有必要不共享或删除这个问题,那么请务必这样做。我正在寻找实际问题或情况的答案。我知道我可以映射到像 Scroll Lock 或 Caps Lock 这样的非打字键,就像其他一些实用程序一样,但这两个键目前都在使用,而不是一个选项。

I'm creating a utility for my mother-in-law in order to remap CTRL-C and CTRL-V commands to one signal button on her keyboard to assist with at home work. On the first press it will commit a COPY command. Next press will be a PASTE command. Since my little application won't be in focus I'll need the use of GetAsyncKeyState. Right now I'm attempting to map this all to the tilde key. How do I kill the tilde key from actually passing to the field selected and overwriting the data or appending itself to the pasted text? Could either use C# in any .NET framework or VB6 for this little applet.

I understand the answer I'm looking for could assist in creating malicious software so if anyone should feel the need to not share or delete this question then by all means do so. I'm looking for an answer to a real issue or situation. I know I could map to a none typing key like Scroll Lock or Caps Lock like some other utilities out there but both of these keys are used at this point in time and not quite an option.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

凑诗 2024-09-13 01:36:12

您必须执行全局键盘挂钩(请参阅 VBAccelerator 了解有关 VB6 中全局挂钩的一些详细信息),然后在收到 CTRL-V 或 CTRL-C 后不要传递消息,然后采取行动。

You going to have to do a global keyboard hook (see VBAccelerator for some details on global hooks in VB6), and then not pass on the message once you have received CTRL-V or CTRL-C and then act on that.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文