用于自定义文本字段突出显示的系统范围热键

发布于 2024-12-04 17:37:16 字数 199 浏览 1 评论 0原文

我想创建一种方法,使我的计算机能够在任何应用程序的任何给定文本字段中突出显示文本,当我键入时。我的想法是按下一个热键,这将导致按下该热键后键入的所有文本都会突出显示,直到我再次按下该热键。哪些技术(如果有)可以在 Windows XP 或 Windows 7 计算机上实现此目的?当前的文本选择行为(例如使用shift+箭头键进行选择,以及按键时取消选择等)在哪里?

I want to create a way of enabling my computer to highlight text in any given text field, of any application, as I type it. The idea is I would press a hotkey and that would cause all text typed after pressing that hotkey to be highlighted until I press the hotkey again. What technologies, if any, could achieve this on a Windows XP or Windows 7 machine? And where do the current text selection behaviors such "live" (e.g. selection using shift+arrow keys, and deselection on key press, etc.)?

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

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

发布评论

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

评论(1

初吻给了烟 2024-12-11 17:37:16

你实现这一目标的可能性极小。

您可以使用RegisterHotKey和键盘挂钩来拦截热键和后续键入。那还不错。

您无法管理的是安排您键入的文本突出显示。您必须对许多目标应用程序进行特殊处理。 Web 浏览器等应用程序通常不使用窗口控件作为其输入字段。当文本被输入到这些字段中时,没有简单的方法来突出显示文本。

您的问题使用了“系统范围”和“任何给定文本字段”等术语。这不是一个现实的目标。使其适用于某些应用程序中的单类字段听起来更合理。当文本将进入窗口编辑控件时,您也许可以执行此操作。尽管这听起来充满了潜在的线程冲突。您也许还可以通过支持 UIautomation 的应用程序取得一些进展,但这似乎并不容易,而且许多应用程序不支持 UIautomation。

It's exceedingly unlikely that you could achieve this.

You can use RegisterHotKey and keyboard hooks to intercept the hot key and subsequent typing. That's not too bad.

What you won't be able to manage is to arrange that the text you type will appear highlighted. You'd have to special case many of the target applications. Applications like web browsers often don't use windowed controls for their input fields. There's no easy way to highlight the text as it is typed into those fields.

Your question used terms like "system-wide" and "any given text field". That's just not a realistic goal. Making this work for a single class of fields in a certain apps sounds more plausible. You may be able to do it when the text is going to land in a windowed edit control. Although even that sounds fraught with potential threading conflicts. You may also be able to make some headway with apps that support UIautomation, but again it doesn't seem like it would be very easy and many apps don't support UIautomation.

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